Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    3 years of work with SGT and my game looks this
    , i am happy that we have SGT!
     
    shadmar and blacksun666 like this.
  2. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Is there a way to make the sun bigger in the SGT Planets for example? Like if the planet is really close to the sun, the sun should be similar in size, as seen through the planet's atmosphere.



    And changing the intensity multiplier only makes the sky really bright like this and the circle is somewhat larger but not by much:

     
  3. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Hi @Darkcoder I'm working on a project that uses SGT extensively. I have a solar system with a single "sun" that has a directional light. I've Added the SGT Light component. I have a couple planets orbiting the star. The terrestrial planet uses the SGT Planet component and a material shader "Space Graphics Toolkit/Planet".

    This has worked before, but I'm having trouble with this new, simple scene setup. Is there another component I need on the planet? Is there a specific material setting I need to select?

    I am expecting the "Treat as Point Light" bool on the SGT Light component would result in the Planet Material exhibiting the same light/shadow characteristics as the Jovian material, but it doesn't.

    (In this first example video, the Directional Light also has the script to point the directional camera at the player, which is why the light appears to change on the terrestrial planet as I move around. The light/shadow changes on the planet shouldn't happen though, as the planet material should respect the SGT Light "Treat Ad Point" bool.)



    Here's an example of turning on/off "Treat As Point". (I also removed the script that pointed the directional light at the player). The Jovian responds correctly, but the Venus material doesn't. The strange thing is that the Venus material responds correctly in another scene with the same Directional Light and SGT Light component setup. I don't know why this scene responds differently.

     
    Last edited: Aug 21, 2022
  4. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Here's a screenshot
     

    Attached Files:

  5. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    I seem to be having an issue with a camera that's using a FloatingFollow component to following an object that's also following another floating object. It starts jumping when the base object is in motion. Is there an issue with FloatingFollow execution order when chaining them together like this, or am I doing something else wrong?
     
  6. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    Does anyone here have a script / advice for getting a players Lat/Long on the planets surface... I am remaking earth and am going to use OSM data to recreate all the cities, etc I have that all working if I feed it gps coordinates manually but I need it to know the coords based on the player/camera position. My attempts so far don't yield the correct results.

    Here is a sneak peek at that system tho.. in case anyone is curious...



     
    onemicmusic101 and shadmar like this.
  7. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    255
    Great asset but i cant set the speed of the stars in infinite field when the camera moves. the sliders dont change anything. Also can i generate the terrain colliders without going close with the camera?
     
    Last edited: Aug 27, 2022
  8. Hollymare

    Hollymare

    Joined:
    Aug 29, 2022
    Posts:
    2
    I want to add the flow feature as jovian guide says, so I added my flow cubemap in the "Flow Tex" in the SGT Jovian attributes and also make "FLOW" enabled in jovian material. I can see the effects of the flow and make sure it works. However the "Flow Tex" attributes in the SGT Jovian is always red and I keep getting the error as follows:

    Material 'Jovian (Generated)' with Shader 'Space Graphics Toolkit/Jovian' doesn't have a texture property '_SGT_FlowTex'
    UnityEngine.Material:GetTexture (int)
    SpaceGraphicsToolkit.Jovian.SgtJovian:get_NeedsFlowTex () (at Assets/Plugins/CW/SpaceGraphicsToolkit/Features/Jovian/Required/Scripts/SgtJovian.cs:279)
    SpaceGraphicsToolkit.Jovian.SgtJovian_Editor/<>c:<OnInspector>b__0_2 (SpaceGraphicsToolkit.Jovian.SgtJovian) (at Assets/Plugins/CW/SpaceGraphicsToolkit/Features/Jovian/Required/Scripts/SgtJovian.cs:445)
    CW.Common.CwEditor:Any<SpaceGraphicsToolkit.Jovian.SgtJovian> (SpaceGraphicsToolkit.Jovian.SgtJovian[],System.Func`2<SpaceGraphicsToolkit.Jovian.SgtJovian, bool>) (at Assets/Plugins/CW/Shared/Common/Required/Scripts/CwEditor.cs:89)
    SpaceGraphicsToolkit.Jovian.SgtJovian_Editor:OnInspector () (at Assets/Plugins/CW/SpaceGraphicsToolkit/Features/Jovian/Required/Scripts/SgtJovian.cs:445)
    CW.Common.CwEditor:OnInspectorGUI () (at Assets/Plugins/CW/Shared/Common/Required/Scripts/CwEditor.cs:51)
    UnityEngine.GUIUtility.processEvent (int,intptr,bool&)

    Is there anything wrong?
    2022-08-30 202905.png 屏幕截图 2022-08-30 202955.png
     
  9. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    I switched my Project to HDRP and the Point Light doesn´t work, when its very far away. How do I can fix it??
     
  10. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    Figured out my issue with planetary coordinates.. in case anyone needs it here is how I did it...

    First I do a raycast from the player.


    Code (CSharp):
    1. if (Physics.Raycast(CharacterTarget.transform.position, -Vector3.forward, out hit, Mathf.Infinity))
    2.         {
    3.             if (hit.transform.name == "Terrain")
    4.             {
    5.                 // Transform into collider's local coordinate system.
    6.                 Vector3 offset = hit.collider.transform.InverseTransformPoint(hit.point);
    7.                 coordinate = new GeoCoordinate(FromVector3(offset).latitude, FromVector3(offset).longitude);
    8.                 //Debug.LogError("Offset point is " + offset);
    9.                 //Debug.LogError(coordinate.Latitude + ", " + coordinate.Longitude);
    10.             }
    11.  
    12.         }

    Next I use this function


    Code (CSharp):
    1. public Coordinate FromVector3(Vector3 position)
    2.     {
    3.  
    4.         // Convert to a unit vector so our y coordinate is in the range -1...1. This makes it so we don't need to worry about the planets radius in calculations.
    5.         position = Vector3.Normalize(position);
    6.  
    7.         // The vertical coordinate (y) varies as the sine of latitude, not the cosine.
    8.         float lat = Mathf.Asin(position.y) * Mathf.Rad2Deg;
    9.  
    10.         // Use the 2-argument arctangent, which will correctly handle all four quadrants.
    11.         float lon = -90 - Mathf.Atan2(position.x, position.z) * Mathf.Rad2Deg;
    12.  
    13.         //Debug.Log(lon + ", " + lat);
    14.  
    15.         return new Coordinate(float.Parse(lon.ToString()), float.Parse(lat.ToString()));
    16.     }

    My coordinate function is this..


    Code (CSharp):
    1. using UnityEngine;
    2. using static UnityEngine.Mathf;
    3.  
    4. // Structure for storing latitude and longitude (in radians)
    5. [System.Serializable]
    6. public struct Coordinate
    7. {
    8.     [Range(-PI, PI)]
    9.     public float longitude;
    10.     [Range(-PI / 2, PI / 2)]
    11.     public float latitude;
    12.  
    13.     public Coordinate(float longitude, float latitude)
    14.     {
    15.         this.longitude = longitude;
    16.         this.latitude = latitude;
    17.     }
    18.  
    19.     // Return vector2 containing long/lat remapped to range [0,1]
    20.     public Vector2 ToUV()
    21.     {
    22.         return new Vector2((longitude + PI) / (2 * PI), (latitude + PI / 2) / PI);
    23.     }
    24.  
    25.     public Vector2 ToVector2()
    26.     {
    27.         return new Vector2(longitude, latitude);
    28.     }
    29.  
    30.     public static Coordinate FromVector2(Vector2 vec2D)
    31.     {
    32.         return new Coordinate(vec2D.x, vec2D.y);
    33.     }
    34.  
    35.     public CoordinateDegrees ConvertToDegrees()
    36.     {
    37.         return new CoordinateDegrees(longitude * Rad2Deg, latitude * Rad2Deg);
    38.     }
    39.  
    40.     public override string ToString()
    41.     {
    42.         return $"Coordinate (radians): (longitude = {longitude}, latitude = {latitude})";
    43.     }
    44. }
    45.  
    46. // Structure for storing latitude and longitude (in degrees)
    47. [System.Serializable]
    48. public struct CoordinateDegrees
    49. {
    50.     [Range(-180, 180)]
    51.     public float longitude;
    52.     [Range(-90, 90)]
    53.     public float latitude;
    54.  
    55.     public CoordinateDegrees(float longitude, float latitude)
    56.     {
    57.         this.longitude = longitude;
    58.         this.latitude = latitude;
    59.     }
    60.  
    61.     public Coordinate ConvertToRadians()
    62.     {
    63.         return new Coordinate(longitude * Deg2Rad, latitude * Deg2Rad);
    64.     }
    65.  
    66.     public override string ToString()
    67.     {
    68.         return $"Coordinate (degrees): (longitude = {longitude}, latitude = {latitude})";
    69.     }
    70. }
     
    Darkcoder likes this.
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sorry for the late replies everyone!

    I recommend making your player's up direction align with the planet center, rather than the surface normal.

    I've noticed the random direction change issue too with the Planet Surfing scene and I'm not sure what causes it. I think it might be a precision issue with the simplex noise.


    As lsgheero mentions, you can specify a night lights texture. You could make a series of textures and swap between them to make it an animation, or modify the texture itself over time.


    You would have to swap the planet surface material's shader to one that renders with flat shading. I'll add a setting to the Planet shader to enable this in the next version.



    This looks like a depth buffer precision issue, as the triangle depth sorting is breaking. You can try changing the graphics API to Vulkan or GLES3 and try different camera ranges.


    This will be fixed in the next version!


    1 - Demo scene 16 already implements a warp pin, so adding 4 stars shouldn't change how this behaves. The star in this example itself is a billboard, so you don't have to add anything.

    2 - It sounds like your floating spawner's Range is set too low.

    3 - Check out demo scene 08 (or demo scene 16), and see how your setup differs from it.

    4 - Demo scene 13 shows you how to create nested spawners. Compare this to your setup..

    5 - This was over 2 years ago so I don't remember, perhaps I temporarily removed it or made a mistake.


    Great job, fantastic editing! I think some of the scenes could be polished up a bit, but overall it's very nice.



    The atmosphere material you pick has the LIGHTING SCATTERING / Scattering Terms setting, which you can adjust to change the size of the light. You can duplicate this material and make many variations.


    The SgtLight component sends light position, color, and intensity data to components like SgtAtmosphere that implement their own custom lighting. The planet surface and other objects in your scene use Unity's native lighting system, which uses the Light component settings. This means there will always be a difference between them, because they use very different lighting models. Lights in SGT are treated as point lights in terms of the direction of the light source, so the rotation of the light itself doesn't matter, but it does matter for other objects.


    The SgtFloatingFollow component executes after SgtFloatingObject so you can chain it once no problem. But SgtFloatingFollow itself runs in Update according to Unity's native scheduling order which I don't remember off the top of my head. This can lead to issues if you have more than one. Maybe if you enable the components in order then they will execute in order, I don't remember.


    Looking great!

    The SpaceGraphicsToolkit.SgtCommon.CartesianToPolar method can be used to convert a planet-relative 3D position into a polar one.


    Can you check the GUIDE asset and let me know which version of SGT you're using? I get no error in the Jovian's 06 demo scene which uses flow.


    I think there's some limitation to point light distances in HDRP. You may have to use a directional light instead.
     
    adsilcott, mattxreality and lsgheero like this.
  12. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    I tried playing with the scattetring terms setting in the editor, but nothing happens. I've got latest SGT+Planets and Unity 2021.3.5. Even imported SGT+Planets into a new project and used the example scenes from Planets.

    Also another question. I want to change the transparency mode for the default Ocean Material provided in SGT with a script from depth to vertical and vice versa.
    defaultOceanMaterial.SetFloat("_Alpha", 2);

    It does get updated but not on the screen, unless I set it manually. Do I need to run some additional command? I tried with MarkAsDirty() but nothing happens.

     
  13. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    Thanks for the reply! I also had the same question as Liminal-Ridges above. When I was first using the infinite star fields they looked great, but as I started using the Floating features and moving the view at more realistic speeds, the speed of the stars became so great that it just looks like noise. I know that they're moving at the right speed, but for visual appeal I'd love to be able to adjust it.

    Edit: As an example. load the Floating Infinite Stars demo and set the camera's max speed to the same value it has in the earth-size planet demo, 25000.
     
    Last edited: Aug 31, 2022
    kplotnikov likes this.
  14. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    Also a little thing:
    I had to add a line of code in the UpdateColliders method in the SgtTerrainCollider class. I need to be able to set the layer of the collider objects that the planet is generating, so I set it to match the layer of the parent object.
    Code (CSharp):
    1. var root = new GameObject("Collider");
    2. root.layer = gameObject.layer; //<- Added this line
     
  15. Wawwaa

    Wawwaa

    Joined:
    Sep 30, 2017
    Posts:
    165
    Check this out for playing at a rotating space station...

     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404

    Oops, looks like I forgot to make the SourceMaterial settings sync with the outer atmosphere material. You can enter/exit play mode to update it. I'll fix this in the next version coming out soon.

    The _Alpha value is only used in the material inspector. The shader itself uses these keywords: #pragma shader_feature_local _ALPHA_OFF _ALPHA_VERTICAL _ALPHA_DEPTH



    You will probably want to configure multiple infinite starfields, and fade each in/out depending on the desired speed ranges and visual effect. You can fade them out by changing the Color's alpha value.


    Thanks, this will be fixed in the next version!


    Super cool!

    It looks like your UI selection boxes jump when the origin shifting system snaps. You may want to hook into the SgtFloatingCamera.OnSnap event and update the positions so this doesn't happen :D
     
    Last edited: Sep 24, 2022
  17. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    So that means that if I want the top speed effect to be slower than the top speed of the ship, then I'll need to render the effect to a different camera moving at a different speed?
     
  18. Darkcoder

    Darkcoder

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

    Version 4.0.9 of Space Graphics Toolkit is now out!
    • Fixed SgtAtmosphere's SourceMaterial not syncing with the sky.
    • Fixed SgtTerrainCollider child layers.
    • Fixed Planet shader's WATER setting to now override NIGHT setting.
    • Added SgtAtmosphere.OcclusionPower setting.
    • Added SgtJovian.OcclusionPower setting.
    • Added FACETED setting to Solid shader.
    • Added FACETED setting to Planet shader.
    • Added FACETED setting to TerrainPlanet shader.
    Enjoy :)

    I recently moved to a new city so I haven't had much time to work on stuff, but things are mostly set up and good to go now.

    Unity Japan also recently interviewed me about my asset work and history. You can check it out HERE (it's in Japanese, but you can probably get by with auto-translate).


    The SgtStarfieldInfinite component has the Stretch / StretchScale setting, so this shouldn't be necessary. If you set this to 0.1 for example, then it will stretch to 1/10 the normal scale.
     
  19. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    I tried that, but it only changes the length of the stretched stars, not the speed that they move. I'd like for it to look like the stars are farther away, so the parallax effect is more subtle.
     
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I see. When I said before that you want to create multiple infinite starfield layers, I meant that each layer would have a different size. The larger you make the star spawning boundary, the farther the camera has to move for the stars within to wrap around. For example each layer might double in size.
     
  21. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    Okay, that makes sense. I was experimenting with changing the size of the starfield before, but I wasn't sure what I was adjusting. I messed with it again and had better results, but still some issues.

    If I'm traveling at about a million meters per second, then I have to make the starfield at least a few million units square before I start to get the speed I want. And I have to set the star count to a similarly high number in order to see any of them, which slows down the editor. I'm also scaling up the stars quite a bit to help the visibility, but with that many stars I started getting memory warnings.
     
  22. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    Hello @Darkcoder firstly, great interview! So cool to learn more about the background to SGT and its creator!!

    I'm currently working on a VR experience and have a solar system simulation. You mentioned that the Jovian, Cloud, and Atmosphere assets calculate their own shadows using the SGT Light script on a directional light. For large scale scenarios like a solar system model about 50000 units in size, what would you recommend I use to let all materials (SGT generated and Unity Materials) show proper shadows from the center sun?

    Also, do you have any additional cube map planet textures I could use with the Jovian system? That would do the trick too. Or, could you point me to a resource that has compatible cube maps for your Jovian planet system?

    upload_2022-9-2_21-51-24.png
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    If you increase the size of the starfield then the density of stars will decrease. If you double the size on all 3 axes then that's 1/8 the density. While you could x8 the star count to compensate, this would lead to there being too many stars. Instead, you should increase the radius of the stars, and also increase the StretchScale.



    Thanks!

    These components calculate their own lighting/shading. Shadows are handled by the SgtShadowSphere/Ring components.

    If you enable the SgtLight component's TreatAsPoint setting, then as long as your sun GameObject is positioned correctly relative to your planets, then the SgtLight direction should be correct.
     
  24. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    Okay, that got the effect I was looking for, thanks!

    But now the stars are flickering, and I can't figure out why. Pulse is disabled. The stars are on a layer that's being rendered by a second camera, but I don't think that's it.

    GIF 9-5-2022 7-09-46 AM.gif
     
  25. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    So I'm trying to layer three different starfields, and having some weird issues.

    One is a layer of "particles" smaller and closer to the ship just to help indicate speed. Those are working fine.
    One is the "star" layer above that's flickering.
    And one is a layer of "dust" that I intend to fade in and out to indicate a stellar medium. It's mostly working but once in a while it resets and it looks like it jumps to a new configuration of clouds.

    So if I watch the particle layer that's working properly. I notice that the transform numbers are staying close to zero, which I understand is the proper behavior since it's utilizing the floating camera snaps. But the other two that are having issues have much bigger numbers and I'm getting the floating point warning message in the inspector. I don't understand this, since they're all using the same component.

    Another thing is that when I enable the dust layer the stars layer doesn't render at all. Is there a limit that I've hit? Total number of stars is only 1200 between the three of them.
     
  26. Quasari

    Quasari

    Joined:
    Jul 21, 2021
    Posts:
    3
    Hi Darkcoder,

    Thanks for addressing my issue regarding masking the night lights appearing on top of the water. I have a feature request I'm hoping you can add so that I don't have to re-add my changes. I found the night light to be lacking in brightness. I'm not familiar with shaders but I was able to add a brightness and increase the sharpness range to 200 for the night texture. Would you consider adding the attached code for 'brightness' and 'sharpness' to the SGTplanet shader?

    I have another request. Being unfamiliar with shaders, is it possible to add a color slider for the night map so we could easily change the 'city' lights' colors using a night texture with a greyscale?
     

    Attached Files:

  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Are you adding the SgtFloatingObject component to your infinite starfields by any chance? This component is designed to automatically work with the origin shifting system, and adding this will break it. See the Starfield feature's "32 Floating Camera" demo scene.

    The dust and starfield effects both use additive blending, so enabling one shouldn't have any effect on the other.


    Thanks, I've added those changes and they will appear in the next version.

    Adding these color features is possible, but I don't think many projects need the ability to choose between a gradient of colors, not to mention that would reduce performance. I could add some kind color tint setting though, then you could change it to any color at runtime without any performance impact?
     
    Last edited: Sep 24, 2022
  28. adsilcott

    adsilcott

    Joined:
    Aug 30, 2014
    Posts:
    55
    No, that's not the issue. The only difference I can see from the example scenes is that my star field size is way bigger for the two that are having issues. I'm going to create a new scene and recreate all of the star fields from scratch to test things out.
     
  29. nighty2

    nighty2

    Joined:
    Dec 29, 2020
    Posts:
    29
    Hi Carlos,

    hope you are doing well!

    [tldr]
    I want to hide a space station inside an nebula (as scientifically inaccurate as that would be).
    How do I do it?
    [/tldr]

    For this, I tried using a custom ring nebula and placing the station in it's empty middle. However, the space station is always visible from outside and I would like to make the nebula (or its center, or a small second nebula, ...) opaque. The only way I found to make the station not visible to an outside viewer is upping the brightness somehow until the nebula center is white, which I don't want because it is way too much.

    I tried playing around with brightness, horiz. brightness, horiz. pwr, creating my own mainTex, making the sourceTex less transparent, multiplying the starCount, trying different shaders (practically no other shaders works at all), lighting..., but I don't achieve an opaque look (other than adding brightness).

    My guess is that the shader is build to behave like this, which probably makes sense for most nebulae.
    Is there anything I can do to achieve what I want?

    I am just talking horizontally here, but plan on creating a "ceiling" and a "floor" nebula to fully enclose the station.

    Cheers,
    Michael
     

    Attached Files:

    Last edited: Sep 10, 2022
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Strange. In this case can you make a very minimal demo scene so I can easily replicate this on my end?

    The starfields and nebulae are all addive blending effects, so they will never hide anything behind them. This is for technical reasons related to draw order.

    To make the gas giant hide behind it you would have to write a custom script that calculates the station 'fade' amount based on the camera position and space station position. This could be as simple as a distance check, but making it fade based on the actual nebula colors and brightness would be difficult.
     
    nighty2 likes this.
  31. nighty2

    nighty2

    Joined:
    Dec 29, 2020
    Posts:
    29
    Hey man, thanks for responding so quickly!

    After experimenting some more, I found a way to achieve the look and I thought of this only after your explanation of the additive nature of the nebulae.

    I reconfigured the standard shader on my spacestation-model and set it to "Fade" and -important- it's render queue to max (3999). When I am closing in on the station, the alpha of all the stations materials get lerped. I don't know if the render queue thing will bite me later, but for now it seems fine.

    An impression is appended.
     

    Attached Files:

    Darkcoder likes this.
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Looks great!
     
  33. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    Why are the Particles of SGT Starfield Nebula invisible, some of my Starfield Nebulas arent invisible. The source Texture properties are same, the main texture are the same.
     

    Attached Files:

  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Could you modify one of the example scenes in a way that demonstrates this issue and send it to me? I don't know what I'm looking at with these images alone.
     
  35. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    here:
     

    Attached Files:

  36. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    I made the galaxies extra small, they are actually 10,000 light years in size
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Can you send me a private message with a unitypackage of this?
     
  38. Hollymare

    Hollymare

    Joined:
    Aug 29, 2022
    Posts:
    2
    I am working with the SGT Terrain Planet feature and adding the SGT Terrain Simplex component to my planet. While it works in the whole game, I come up with the error when I stop the game process:

    InvalidOperationException: The previously scheduled job SgtTerrainSimplex:HeightsJob reads from the Unity.Collections.NativeArray`1[System.Single] HeightsJob.AreaWeights. You must call JobHandle.Complete() on the job SgtTerrainSimplex:HeightsJob, before you can deallocate the Unity.Collections.NativeArray`1[System.Single] safely.
    Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <066b41adfd1c4a3b90759d491f1499e8>:0)
    Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& safety, Unity.Collections.LowLevel.Unsafe.DisposeSentinel& sentinel) (at <066b41adfd1c4a3b90759d491f1499e8>:0)
    Unity.Collections.NativeArray`1[T].Dispose () (at <066b41adfd1c4a3b90759d491f1499e8>:0)
    SpaceGraphicsToolkit.SgtTerrain.ScheduleDispose (System.IDisposable disposable) (at Assets/Plugins/CW/SpaceGraphicsToolkit/Features/Terrain/Required/Scripts/SgtTerrain.cs:110)
    SpaceGraphicsToolkit.SgtTerrainSimplex.OnDisable () (at Assets/Plugins/CW/SpaceGraphicsToolkit/Features/Terrain/Required/Scripts/SgtTerrainSimplex.cs:59)

    It seems that the Simplex process doesn't get disposed properly and cause the memory leak.

    The demo works well but I get the error above on my own project. My current SGT version is 4.0.8.

    Is there any way to solve that issue? Thanks.
     
  39. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    Has anyone implemented a day/night cycle on the planets surfaces. I thought about doing a rotation of the sun/moon around the planet with the planet acting more like the center of it all instead of the sun.

    also @Darkcoder Not sure if this is a bug or maybe I just don't have something set correctly but when its night on the planets surface as a player on the surface the sky is just pitch black, Is that normal and if so any thoughts on how I might resolve that so the player can see space during night time?
     
  40. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    How can i make it and where private?
     
  41. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    You make a unity package by right clicking on the asset/folder in unity and saying create assetpackage. Then to PM him you just use this forum and send him a private message. Can be done if you click on his name. Most likely you will need to upload the package to your google drive, etc then just PM him a link to it.
     
  42. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
  43. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    where do i need to go when i click on his name
     
  44. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    upload_2022-9-21_11-33-35.png
    start a conversation...
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I need step by step instructions on how to replicate this error from one of the example scenes.


    You can set the SgtAtmosphere component's Night / NightSky setting.
     
  46. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    is this normal in hdrp, how can i fix it, why they arent transparent. Alpha Is Transparency is on
     

    Attached Files:

  47. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    i fixed it
     
    Darkcoder likes this.
  48. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    why doesnt the black hole work with starfield in hdrp
     

    Attached Files:

  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Which version of Unity?

    You may have to change the starfield material's Render Queue setting. For example, you could try 2450 or 2000 or something.
     
  50. foxyspace

    foxyspace

    Joined:
    Oct 16, 2021
    Posts:
    71
    I am using 2022.1 beta, i am using it because i cant build my game on other versions, and there isnt a render queue, just priority.