Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    And another bug report for Unity 2020.1 and later:

    1. When editing a prefab "In Context", in other contexts than "Normal", (i.e. Gray or Hidden), most custom geometry also keeps rendering. That means that if you have a Jovian at 0/0/0, you must edit your prefabs in very dense fog. :p :) See mouse cursor near context buttons.
    upload_2020-11-19_23-36-10.png

    2. Furthermore, these objects render even into the pure prefab stage (the blue one that you get by double-clicking a prefab). See mouse cursor near bottom of screen. That's especially bad because in that case, most prefabs are at 0/0/0 and anything from the normal editor scene isn't even supposed to be rendered.

    upload_2020-11-19_23-35-18.png
     

    Attached Files:

  2. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,155
    Are planets visible in the editor or are they created only in runtime?
     
  3. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    Both, a lot of stuff runs as [ExecuteAlways], so yes you can see them in Edit Mode
     
    angel_m likes this.
  4. TheGreaterGameCreator

    TheGreaterGameCreator

    Joined:
    Nov 18, 2020
    Posts:
    9
    I've had your asset installed for a while now, and I haven't touched unity in a bit since quarantine. I haven't really used your asset and I don't know how to set an lod terrain to some of the planets. Can you help point me out to that please? (My unity skills and kknowledge on these terms are quite low btw)
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    The popping should be reduced when using a Detail level of 2 or 3. The examples use a setting of 1 which is the default and is fairly low resolution for high performance. I'll see if I can implement better LOD smoothing in the next version.


    These have been fixed, I think.

    Begin by going through the demo scenes in the Features/Terrain folder, and read the description.
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Hey everyone,

    Version 3.7.7 of Space Graphics Toolkit is now out!
    • Fixed WebGL error from texture creating components.
    • Fixed inspector values not updating from texture creating components.
    • Fixed potential recursive loop from floating origin system components.
    • Fixed scene objects appearing in prefab mode.
    • Fixed scene objects appearing when hidden.
    • Added SgtJovian.CameraOffset setting.
    • Added SgtTerrainPlanetMaterial.ClampHeights setting.
    • Added SgtTerrainPlanet LOD smoothing.
    • Updated Jovian demo scene to include aurora.
    • Updated lighting in Earth Sized Planet scene.
    • Updated lighting in Obsidian Planet scene.
    Enjoy :)
     
    mattxreality, Arkolis, JFI66 and 3 others like this.
  7. TheGreaterGameCreator

    TheGreaterGameCreator

    Joined:
    Nov 18, 2020
    Posts:
    9
    I think I remember installing 3.6. something on your asset. I'm not sure if that's why I don't have some stuff in tutorials. I think I should try updating.

    (Edit: It wont let me update my asset, it doesnt even show on the shop :[
     
    Last edited: Nov 20, 2020
  8. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    Thank you for the update! I appreciate it.

    Still needs a little bit of work - I'm on on 3.7.7, the Gizmos disappear but the actual mesh/frags still get rendered.
    (in this vid, the backdrop, the ring, the auroras, and the gas giant should disappear as I toggle visibility)

    Deactivating the Gameobjects works, but not the visibility flag. Of course, deactivating GO would also deactivate it in the game.


    And prefab mode also still doesn't quite do what it should. :)



    (I need to set ShareX to record the mouse... first is a doubleclick on a prefab, then it's opening a prefab from the scene, and toggling the context modes)
     
  9. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    4
    Just two quick mistake/typos (copy paste and forgot) i saw in some of the demoscenes. Features > Universe > 07 Floating Spawner (Ring): "This shows you how the SgtFloatingSpawnerSphere (...)" Should be "SgtFloatingSpawnerRing". And in 08 Floating Spawner (Orbit): it should be "SgtFloatingSpawnerOrbit"

    I really enjoying working with your asset. worth every penny!
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Contact Unity if your purchase disappeared. Or perhaps you've logged into the wrong account. If you can't update then you may have t delete the previously downloaded/cached version which is located inside THIS folder.


    Are you sure you updated to 3.7.7? Check the Space Graphics Toolkit/GUIDE.

    I just tested 3.7.7 in 2020.1.3f1 and it seems to work as expected.


    Fixed!
     
  11. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    Thanks, yes it's indeed not properly updated even though Package Manager insists it is. Sometimes the PackageManager shows that there are files to upgrade, and once these are imported, it says "No files to import" and the Guide still says 3.7.6.

    I then deleted all the files, and reimported the package... and it's still 3.7.6.

    upload_2020-11-21_18-24-33.png

    I unpacked the package, and the Documentation.html file (which I guess the Guide script pulls its version from) says:
    Code (Boo):
    1. <title>Space Graphics Toolkit - Documentation - 3.7.6</title>
    EDIT: This is likely a problem with unity's package manager... it seemed that the file was the old package. I deleted my packages cache and redownloaded and then it had the right package.

    As a token of my gratitude for this fix, I used the new Guide button to go and upgrade my review. :) Very nice job, thank you!
     
    Last edited: Nov 21, 2020
  12. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    179
    You don't even need to do that. Just close and reopen Unity.
     
  13. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    I did that a few times though.
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Indeed, the asset download system has always been a mess. When I tried it, it was importing a 2 year old version from when SGT was in a different category, so I had to delete that as well as the new one. No amount of downloading and restarting fixed that.
     
  15. Thygrrr

    Thygrrr

    Joined:
    Sep 23, 2013
    Posts:
    268
    Minor issue - the visibility setting doesn't take into account the global settings per scene-view:



    It's this button, on the right view, the hide settings should be ignored (as they are for the gizmos)
    upload_2020-11-22_11-48-40.png
     
  16. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    4
    Spawn Hierarchy
    1 - Spawn a few galaxies.

    2 - When the camera gets close to a galaxy, spawn some billboard sprites inside that represent massive star clusters.

    3 - When the camera gets close to one of these clusters, spawn some smaller clusters inside the massive cluster.

    4 - When the camera gets close to one of these smaller clusters, spawn even smaller clusters inside this.

    5 - When the camera gets close to this even smaller cluster, you can now spawn some actual 3D stars.

    How do i use the floating spawn system to spawn a 3D Star on a fixed point/exact point in the universe. There is no floating "spot" spawner and i cant select 0 on "radius min" and "radius max" on the other spawners.

    I want to build one galaxy with exact star positions.

    Maybe i dont see the obvious... :D

    EDIT: My workaround is using floating spawner sphere/ring with radius to 1 Meter. that works :D

    And i have to say the demo scenes are so well made and easy to understand. Wow. Great work
     
    Last edited: Nov 23, 2020
  17. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    12
    Been gone for a while but now Im back making this game. @Darkcoder did you make trees, water and grass for the planets. If not how do you recommend I do that?
     
  18. ethaneditsbusiness

    ethaneditsbusiness

    Joined:
    Feb 6, 2020
    Posts:
    13
    Is it possible to have a first person controller that walks around one of these planets? So that the gravity matches the planets (in a circle) ?
     
  19. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    4
    Take a look at the demo scenes. In Shared -> scene 06 and 07 show the sgt gravity components. Slap them on your first person controller.
     
  20. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    12
    Im no good at coding and I keep getting compiler errors can someone help? Thank you
     
  21. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    327
    We need more information. Please post the errors.
     
  22. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    12
    I'll deleted that project Ill try re downloading it.
     
  23. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    12
    167 compiler errors smh
     

    Attached Files:

    • wtf.png
      wtf.png
      File size:
      151 KB
      Views:
      42
    • wtf2.png
      wtf2.png
      File size:
      124.7 KB
      Views:
      39
  24. onemicmusic101

    onemicmusic101

    Joined:
    Oct 10, 2018
    Posts:
    12
    Right when I import the asset into my project this happens
     
  25. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    327
    onemicmusic101 and Darkcoder like this.
  26. TheGreaterGameCreator

    TheGreaterGameCreator

    Joined:
    Nov 18, 2020
    Posts:
    9
    That's funny, mines says it doesn't even exist when I clearly have it. I'm thinking of contacting unity soon. Hopefully I get this done for my project soon one way or another.
     
  27. TheGreaterGameCreator

    TheGreaterGameCreator

    Joined:
    Nov 18, 2020
    Posts:
    9
    I finally upgraded! However, I have a question. Why is the lightning shaped like actual lightning rays at that size? Realistically they would be soft glows in the clouds of the planets happening at procedural times and sizes, and they would be way smaller. I would favour this for my game. Any thoughts on doing something about this at all?
     
  28. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    4
    You could make a sprite/ multiple sprites that looks more like something what you have in mind.
     
    TheGreaterGameCreator likes this.
  29. TheGreaterGameCreator

    TheGreaterGameCreator

    Joined:
    Nov 18, 2020
    Posts:
    9
    Yeah, I didn't see how to use the settings to do that because I am an idiot at times, but I think that makes sense since the lightning mesh it uses is a sprite itself. Right now though, I am having a bit of trouble with LOD planets and height mapping. I want to achieve an affect like Dirkjacobasch's but I'm having difficulties. I assume the terrain component is what is needed for the level of detail stuff, so I put in some free heightmaps from scope but it says when I import it "Texture '4k_eris_fictional' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the texture import settings." So I went on to the texture settings but I dont really know what to change. Am I supposed to change the texture type to something? I made sure the projections were equirectangular.
     
  30. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    179
    upload_2020-11-27_8-40-14.png
     
  31. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    39
    Warp glitch with geometry
    Hi, I have the InfiniteStarfield "warp" stars in my scene which causes a glitch in model geometry (image 1).
    If I turn off that starfield the geometry looks ok.
    What might cause this?

    Second question: is the DepthCamera no more? It doesn't appear as an item when adding SG toolkit items to the hierarchy.
    Unity 2019.4 15f1 LTS, Windows 10.
     

    Attached Files:

  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    I'll try and fix this in a future version. Unfortunately Unity doesn't provide a simple method to know when an object should be drawn or not, and since many of these features are new to 2020 and put in experimental APIs I'm hesitant to manually test if they should be drawn. The latest version should fix most common scenarios though.


    Indeed, I only made one example lightning texture which is based on a picture of real lightning. To make it look like lightning inside a hazy atmosphere or clouds you could blur the lightning texture. I'll see if I can include some more example textures, as 1 definitely isn't enough.


    Did you change the SgtStarfieldInfinite.BlendMode to AlphaTest? If it's Default or either of the Addtivie modes then I can't see why this would happen. You can also try increasing the Transform.Scale (e.g. 10, 100, 1000). This will eventually make the stars render behind your object, which might fix it.
     
    TheGreaterGameCreator likes this.
  33. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    15
    Regarding the prefab spawner:
    If Limit is equal to Resolution, the farthest objects should be properly spawned, but apparently they are not being rotated in spawn().
    I've been trying to edit this script to apply rotation at the beginning of schedule, but this is a bit trickier than I thought it would be. I'm still seeing prefabs appearing sideways. Is sweep resetting everything outside radius, every frame?
     
  34. Cezar214

    Cezar214

    Joined:
    Feb 11, 2017
    Posts:
    5
    Ok it's 12:22 AM and I still didnt figured it out.It may be crazy what i am trying to do as I am still new to unity so here is my problem:

    I plan to make a symple multiplayer game with Floating Point origin scripts provided in this asset store.I know it is crazy and so, but I dont care about server authority and I need something basic to start from.Right now I only want to make 2 player ships sync over the network with floting point.

    I have a basic understeanding of how the floting works, but I have couple of questions in order to make this happen.

    1.I need a coordinate-based system to transfer between clients.In other words I need a global position information to send.
    2.I need to get that position from the server and calculate the relative position from the camera and update the other player game object acordingly.


    In other works I don't know what I should send to the server and how I will calculate the relative position based from what I am getting from the server.

    I really need some advices as I cannot find relevant info online and I feel that this is not an impossible task.
     
  35. dirkjacobasch

    dirkjacobasch

    Joined:
    Apr 24, 2018
    Posts:
    327
    I don't know how big your universe is, but I would use somthing in the center. E.g. if you have a single solar system I would send the distance and direction vector from the sun. With this information it should be possible to calculate the position of the other player.
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Hey everyone,

    Here's a sneak peak of the new lightning textures I've been working on.

    lightning.gif

    These will appear in the next version :)


    It depends what your modifications are trying to do. Sweep will destroy all previously spawned prefabs that were not unmarked from UpdateColliders (I need to update that method name). This works by treating the planet as a giant cube where each face is split into a grid of resolution*resolution quads, and a similar cube of radius*radius quads will be placed at the camera, and the intersection of these two shapes will be where the prefabs will gradually spawn, or instantly despawn if outside.

    If you're talking about the SGT floating origin system (Universe feature), then all floating objects in your scene should use the SgtFloatingObject component. This inherits SgtFloatingPoint (as does SgtFloatingCamera), which ultimately stores the SgtPosition (Position property). So 'all' you have to do is write some code to send and receive this SgtPosition data (3x double + 3x long), and apply it to the correct object. There's no point in sending Transform.position values, because each client will likely be dealing with a different origin.
     
  37. Hellgeist

    Hellgeist

    Joined:
    Feb 13, 2017
    Posts:
    15
    That looks excellent, man. Well done!
    I was just trying to get all the trees to be upright when they spawn, and can't find what is causing them not to.
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Did you try the built in SgtTerrainPrefabSpawner.Rotate = ToPlanetCenter setting? This seems to work fine. As soon as a prefab is spawned its rotation will be updated based on this setting.
     
  39. Cezar214

    Cezar214

    Joined:
    Feb 11, 2017
    Posts:
    5
    Thank you for your answer and Nice work man!

    I just want to make sure that I understeand corectly what you said:

    I understeand that I have to take the Sgt position of the camera(CURRENT PLAYER) (See the values in the picture) and send them throught the network
    upload_2020-12-1_10-0-49.png


    And on other CLIENTS I only need to update the position of the corespoinding game object here
    upload_2020-12-1_10-3-41.png

    And everything should be ok on every client, is that right?
     
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    If your current player position is defined by the camera position (i.e. only using SgtFloatingCamera), and not a separate object like a spaceship the camera is orbiting around, then yes that is right.
     
    Cezar214 likes this.
  41. Cezar214

    Cezar214

    Joined:
    Feb 11, 2017
    Posts:
    5
    Yay.

    And if I have 2 clients connected and I want to sync an Asteroid Gameobject that contains StgFloatingObject(from client 1 to client 2) I just send the local and global vars and update those on the client 2 and it should work, right?

    And my last question is :What is the best practice to get the sgt values from the component? I just call this.GetComponent or is a better way to do this? (I want to implement the optimised method from the start and not do any junky code).
    Thank you and sorry for posting too often.I think this project needs a Discord server as it gets verry big.
     
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Exactly.

    The .Position data is universal across all systems, so sending/receiving this alone is sufficient for everything to be in the right place. If you update .Position directly then you must call the PositionChanged() method after, or you can call SetPosition(...) which will auto do this. You can also hook into the .OnPositionChanged event to know when you need to send it again.

    The easiest way to implement this is to make a custom component that sits alongside the SgtFloatingCamera and SgtFloatingObject, and you just GetComponent<SgtFloatingPoint>() and store it somewhere. Either way, you should get it working first before you worry about any optimizations.
     
    Cezar214 likes this.
  43. Cezar214

    Cezar214

    Joined:
    Feb 11, 2017
    Posts:
    5

    Thank you verry much.I am getting started on this after I am getting home.Btw can you make a discount or something for the planet packet? I plan to buy it
     
  44. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    35
    Hi @Darkcoder After upgrading to the latest SGT I'm getting a series of compiler errors related to two scripts: SgtOcclusionScaler.cs and SgtDepthScale.cs. The errors point to sections in both scripts that deal with CustomEditor code. upload_2020-12-1_14-28-51.png
     
  45. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    35
    Here are some of the errors:

    Assets\Space Graphics Toolkit\Features\Shared\Scripts\SgtOcclusionScaler.cs(81,15): error CS0101: The namespace 'SpaceGraphicsToolkit' already contains a definition for 'SgtDepthScale_Editor'

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

    Assets\Space Graphics Toolkit\Features\Shared\Scripts\SgtOcclusionScaler.cs(79,3): error CS0579: Duplicate 'CanEditMultipleObjects' attribute

    Assets\Space Graphics Toolkit\Features\Shared\Scripts\SgtOcclusionScaler.cs(80,3): error CS0579: Duplicate 'CustomEditor' attribute
     
  46. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    179
    Those errors generally mean you have a duplicate class in your codebase. If I had to guess, (haven't checked,) I'd say you ran the upgrade without deleting the old SGT folder, and some of the scripts have the same name but have been moved to a different place in the folder hierarchy, so the compiler is picking up the old one as well as the new one. That would cause what you're seeing.
     
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    You may be in luck during the new year week ;)


    These files were removed in a recent update. As MasonWheeler says, you can delete the SGT folder before updating to ensure you update properly.
     
    mattxreality likes this.
  48. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    35
    Thank you @Darkcoder . That must be the issue. I'll delete SGT folder before updating.

    I have another question: How can I get the asteroid belt objects to effect the Overlay scaling? I was able to do this in previous versions, but it doesn't work the same in the latest version. I would like to have the belt and ring effect the SGT Occlusion Scaler, but they don't seem to respond like solid objects (e.g. planets).

    As an example: I added a Belt Simple object to the planet on "Storm Planet" scene. The asteroids don't cause the billboard overlay to scale when the pass between the camera and overlay.

    upload_2020-12-2_14-33-38.png
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Currently there's no way to do this. The previous occlusion scaler would render the scene between the camera and light and scale the light flare based on how many pixels were occluded along the way. This worked well, but it didn't work at all in the new render pipelines, so I had to replace it with the new system which raycasts the scene and also manually calculates the occlusion from volumetric objects like gas giants and atmospheres. This works better than the previous system in terms of performance and compatibility, but components without colliders like SgtBelt need custom code to check for occlusion. I plan to add this code in an upcoming version.
     
    mattxreality likes this.
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,501
    Hey everyone,

    Version 3.7.9 of Space Graphics Toolkit is now out!
    • Added SgtBeltCustom.Occlusion setting.
    • Fixed SgtBeltSimple.Layout settings not showing.
    • Fixed SgtStarfieldCustom.Layout settings not showing.
    • Fixed SgtBeltCustom inspector.

    The SgtBelt components can now occlude light from flares as @mattxreality asked. You just need to convert them to the SgtBeltCustom (via context menu/gear icon Make Editable Copy) and you can set the new Occlusion setting. This can be increased based on how quickly you want them to block out the light. Keep in mind this is done on the CPU rather than the GPU as before, so it's more expensive. If you have a lot of asteroids I recommend you only use this for the larger and hopefully less numerous asteroids. You can then fill it in with smaller normal asteroids without occlusion.

    I also added the SgtBelt.CalculateLocalPosition method, which can be used with SgtBeltCustom to calculate the local position of an asteroid at the specified time (OrbitOffset). This could be used to pick asteroids or something.

    Enjoy :)
     
unityunity