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,413
    Well, most assets are designed to fill the needs of as many games as they can within the scope of what they were designed to do, so it's inevitable that the more specialized games would need to makes a lot of changes for them to work well. For example, all SGT stuff uses standard Vector3 positions, which is clearly unsuitable for most real-scale space games. However, integrating a more advanced coordinate system into the code would make it way harder to use, and not be compatible with any other asset or project without advanced knowledge.

    I don't have any solutions for you, but I have thought about creating a different kind of asteroid ring component, one that spawns stuff near the cameras rather than spawns everything from the start. However, writing such code is very difficult because there are just so many edge cases, or special requirements for many games that make writing a single generic solution very difficult.
     
  2. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Looks like scattering on Jovians breaks when in front of very bright objects. See the screenshot:
    Mie.png
    It turns black in the intersection. I am using an HDR camera.

    Here is the same effect on the rings:
    Rings.png
    I think I talked to you about this before and it got fixed. Regression?

    Another issue is that very bright objects appear to shine through Jovians if Limit Alpha is enabled (the red arrow is pointing at the artifact):
    Limit Alpha.png
    Again, this is using an HDR camera.


    I am using Unity 5.2.
     
    Last edited: Sep 7, 2015
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    If I recall correctly this issue is caused by shaders outputting alpha values that are outside of the 0..1 range. I'm not sure if I ever adding clamping to these values in the main SGT release (I don't see it in the current shaders), but to test you can try adding some. Just add the line:

    Code (csharp):
    1. o.color.a = saturate(o.color.a);
    In SgtRing.shader between lines 143 & 144, and SgtJovian.shader between lines 188 & 189.

    I'll test it out later.
     
  4. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    Hi , nice looking tools, in the asset store it shows a Planet with LOD on it .

    But the web player demo doesn't' show it, it has a textured sphere planet only. Does this package generate procedural planets with LOD ?
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Yes, all features listed on the store page are included in the package.

    I didn't include a planet LOD example in the demo Web Player because I don't think it's a particularly impressive feature compared to the other ones showcased there.
     
  6. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    Thanks for your reply.

    Does it generate planets procedurally then ?
    Any chance I can see and example of the planet LODing ? Or some more detailed information about how it works please.
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    No, it doesn't generate procedural planets. It just increases the detail of the planet mesh as you approach it. It's designed to be an alternative to manually specifying what resolution of mesh you want planets to have, and also allows you to specify a heightmap to add some variation to the terrain heights.

    THIS is an example of what it might do for a planet with just a diffuse shader & texture. Though with a more advanced shader and higher resolution texture set it would look much better, and with some modifications to the code it could be made procedural, but that's a rabbit hole I'd rather not go down just yet.
     
  8. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Hey,

    I'm working on making procedural Jovians using Substance Designer. Any tips for converting the Jovian script to use a 2D texture instead of a cubemap?

    Thanks,
    -Tristan
     
  9. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    SGT 2 used 2D/equirectangular textures for gas giants/jovians, but I changed this because they were way too slow and basically made them useless for anything besides desktop. In order to use these 2D textures you have to use really slow trig functions to convert from spherical coordinates to cartesian, which the code could still be modified to do.

    I recommend you convert the substance textures to cube maps as it will run much faster.
     
  10. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Hi, I was wondering how this asset is in comparison to Space Scene for unity and if any of the stuff would be interchangeable between the two. Or are they just completely incompatible and do basically the same thing? I like Space for Unity (Space Scene) because it already has a nice little controller in it for a ship. Does yours have this?

    Or is this merely just to generate objects I need that I could throw into other projects?
     
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    As far as I know Space focuses on providing media, like planet textures, high resolution backgrounds, etc, and comes with scripts to quickly generate space backgrounds.

    Whereas Space Graphics Toolkit is more about giving you full control over each individual space element in your scene. For example, the atmosphere shader has many options that allow you to control the atmosphere thickness, sunrise colors, shadows, etc. It also comes with similarly flexible scripts & shaders for many different space phenomena as you can see on the asset store page. I believe the media provided with Space is fully compatible with the scripts & shaders of Space Graphics Toolkit though.

    The current version of SGT doesn't come with any kind of spaceship controller, as it's mainly focused on giving you control over the graphics.
     
    wolfen231 likes this.
  12. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Great that's mainly what I wanted to know. I was just thinking I could generate some stuff with your set and implement them in to Space Scene as part of the stuff that gets generated. Your stuff looks much more visually appealing. Not to downplay Space Scenes stuff. It's solid too.
     
    Last edited: Sep 17, 2015
  13. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Hey Darkcoder,

    I have a scene made with SGT2 that works perfectly. Upgrading it to SGT3 would take a considerable amount of time, also the end result might not be as visually appealing as the original one (mainly because I'm not that good with photoshop). I'm trying to make this SGT2 scene work with the latest version of Unity, but I'm getting the following errors (only at runtime - SGT 2.7.3):

    cleaning the mesh failed
    UnityEngine.MeshCollider:set_sharedMesh(Mesh)
    SGT_Mesh:Update() (at Assets/Procedural Galaxy/Scripts/Library/SGT_Mesh.cs:212)
    SGT_MultiMesh:Update() (at Assets/Procedural Galaxy/Scripts/Library/SGT_MultiMesh.cs:300)
    SGT_Starfield:Regenerate() (at Assets/Procedural Galaxy/Scripts/Player/SGT_Starfield_Procedural.cs:50)
    GalaxyGUI:regenerateStars() (at Assets/GUI/Scripts/Scene1/GalaxyGUI.cs:251)
    GalaxyGUI:Start() (at Assets/GUI/Scripts/Scene1/GalaxyGUI.cs:233)

    Is there any solution to this, besides of course, remaking the entire scene in SGT3?

    Thanks,
    Raydekk
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hey,

    I've never heard of this error before, but after searching it seems it might be related to mesh colliders having a scale of 0.

    However, since that's from the Starfield script I'm not sure why it's calling the code to update mesh colliders.

    Maybe you could try manually disabling the collider generation by opening the debug inspector (button to the right of the inspector padlock), and finding the 'starfieldMultiMesh' field inside the SGT_Starfield component, then finding the 'hasMeshColliders' field inside that and setting it to false. This should prevent that particular error.
     
  15. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Worked perfectly, errors gone!

    Thanks
     
    Darkcoder likes this.
  16. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Space for Unity also works on Unity 3x and 4x, whereas SGT requires 4.5+
    I bought both and use Space for Unity more for graphical projects as it supports more platforms as it doesn't rely on the Sprite class and SGT when I need procedural planets.
     
    wolfen231 likes this.
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    SGT 3.1.3 is now out!

    It removes the warning in Unity 5.2, improves a bunch of demo scenes, optimizes the displaced terrain component, and adds the Displaced Mesh component, enjoy!
     
    Korindian likes this.
  18. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Amazing package. Do you think you can sell some of the effects separately? I only need the warp drive effect for my game.
     
  19. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    I've thought about it in the past, but most of the demo scenes use combinations of effects, so separating them might make them all look a bit boring. It also makes organizing the source code more difficult, as many of the components share various scripts and features, or otherwise interact with each other.
     
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hey guys, I've updated all the free packs to work with the latest version of SGT (you can get them from the first post on the first page).

    I've also made a new free pack, enjoy!

    [FREEBIE] Alien Worlds Pack
    This demo pack contains six unique alien worlds with their own texture sets, atmospheres, and scenes.


     
    Patico likes this.
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hey guys, I thought it was about time I added a new feature to SGT, and here it is in version 3.1.4:

    Planetary Lightning


    The way the lightning is animated is actually very cool and can look amazing with the right media!
     
  22. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    New error.
    In SGTObserver you use public Camera Camera;
    both capitalized.
    Then in SGT_Starfield foreach (var camera in Camera.allCameras)
    instead of looking in Unity's Camera class, it tried to find it in the public Camera Camera; and now throws errors when other script
    SgtStarfield_Editor.cs(29,55): error CS0117: `Camera' does not contain a definition for `allCameras'
    I don't even use the asset anymore. too many complications with each update such as this and now anyone who used it with Unity 4.01 can no longer use it.
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    There's nothing wrong with this.


    This error is from SgtStarfield_Editor, which is a different class to SgtStarfield (nor does it inherit it). SgtStarfield_Editor does not define Camera, so there's no way these two are related. This error is probably caused by you trying to use the latest (or recent) version of SGT with an old version of Unity that doesn't yet implement the UnityEngine.Camera.allCameras property (e.g. Unity 4.0.1). If you look at the asset store you can see that the latest version of SGT has been submitted for Unity 5.0.0 and beyond, so that means it isn't expected to work in earlier versions. If you want to use SGT with Unity 4.0.1 then you'll have to use an earlier version which I can send to you if you wish.
     
  24. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    Just bought SGT and imported the basic package and the solar system package. Seem to be missing textures for Saturn's rings, can't find them anywhere in the packages. Am I missing something or do they have a non obvious name? Really need to use Saturn asap, so will make my own ring texture, but would love to have the original from the asset. The main texture for Saturn itself was not imported as a cubemap, but manually fixed that. Using U5.2.2.
    Other than that, very cool asset.
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Did you download the latest Solar System Pack (2015/10/15)? I updated them a few weeks ago.

    The Saturn ring texture is in 'Space Graphics Toolkit/Examples/Solar System Pack/Saturn Ring'.

    I just tried importing it in the latest version of Unity and it seems to work fine for me.
     
  26. CosmicLab2

    CosmicLab2

    Joined:
    Aug 3, 2013
    Posts:
    35
    The link on your website at https://sites.google.com/site/carloswilkes/ is to the old solar system asset. I was using that. The link on the unity forum is to the new version, so imported that, and all is good. Thanks for the quick reply!
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Oops, updated!
     
  28. M_oenen

    M_oenen

    Joined:
    Oct 21, 2015
    Posts:
    5
    Very Cool !!! Thanks
     
    Darkcoder likes this.
  29. VRTheory

    VRTheory

    Joined:
    Oct 30, 2015
    Posts:
    2
    Wanted to say this Asset is awesome, and pretty easy to work with once you figure out the basics.

    Can someone walk me through (from a higher level, at least) what I'd need to do so that my sun texture uses animated noise instead of a static image? I'd like the surface to have a slow roiling effect, but not sure if it's possible to implement without moving to SM3.
     
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    If you look at the Sun 1/2/3 example scenes in the Solar System Pack you can see that the surface of the sun is a basic sphere with an unlit sun texture, and then the corona/atmosphere is rendered on top as a separate material.

    So to make the surface texture animated you have to replace this first unlit material with some kind of animated shader. SGT doesn't come with such a shader (yet), but I imagine you could make one in SM2 fairly easily, but it entirely depends on what kind of animation effect you need it to have.

    If you're not familiar with writing shaders then perhaps you could make something in Strumpy/Shader Forge. I will see if I can make some kind of shader for the next version of SGT though :)
     
    VRTheory likes this.
  31. VRTheory

    VRTheory

    Joined:
    Oct 30, 2015
    Posts:
    2
    Darkcoder,

    Thanks for the reply! That would be really cool- I will look at shader stuff, haven't learned much about the syntax or functionality of them yet.

    One more question- when I do a build, planets with an SGT atmosphere script are showing up like a white sphere. Is it because the atmosphere script uses some Pro features, or am I doing it wrong? No matter what angle directional light, or even if I try a point light, it ends up looking that way.
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Which exact version of Unity are you using? Which platform are you trying to build to? Which version of SGT are you using? Did you try building just the example atmospheres? As of Unity 5, SGT doesn't require any pro features, and I haven't encountered any issues with the atmospheres while testing.
     
  33. Deleted User

    Deleted User

    Guest

    Hey guys, i'm working on the project for WP 8.1 (or WSA shortly speaking) devices and i have encountered with some problems.

    Firstly, it seems to be that IsSubclassOf in not supported when targeting WSA.
    For example this causes compilation error:
    Code (CSharp):
    1. static SgtClassPool()
    2.     {
    3.         if (typeof(T).IsSubclassOf(typeof(Object)))
    4.         {
    5.             Debug.LogError("Attempting to use " + typeof(T).Name + " with SgtClassPool. Use SgtObjectPool instead.");
    6.         }
    7.     }
    So i had to comment out the whole static constructor and it helped. Would be nice if you include it in "define" block in future releases.
    The same goes for SgtObjectPool class.

    Secondly, shader compilation error occurs after the export of the project in VS:
    Build runs fine, but all planets are entirely pink:D

    P.S. Unity 5.2.2 + VS2015 + SGT 3.1.4
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    I don't see any errors when compiling for WP8, dunno how to build for 8.1 though. I can probably easily add such a check though.


    Interesting, I'll see if I can jiggle around the shader features to avoid this error.

    If you're not using HDR rendering then I believe you can just remove line 186 (o.color.a = saturate(o.color.a);) to fix this (adding that line is what causes that extra instruction).
     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413


    Hey guys, SGT has been included in the Birthday Bonanza Sale!

    If you haven't got SGT yet then please consider buying it. If you already have it then please spread the word, thanks!
     
  36. Deleted User

    Deleted User

    Guest

    Well, in my case it's enough to switch platform to Windows Store and click build:D
    I have attached a screenshot, but it's difficult to understand what a hell is going on there.

    Thanks, now everything works (probably:D)
    Though i have to investigate some performance issues and why the surface in "Lighting" demo is not visible, but that's another story:rolleyes:
     

    Attached Files:

  37. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Are you planning to add something like more demo scene to showcase what can be done with the package?

    Also do you have plans for planetary landing? I tried the other similar package to this and they have a rudimentary planet surface...although it hasn't been updated for ages.

    Just trying to figure out if this project will evolve or just be abandoned; I have a long term project that would benefit from your asset, but if I have to start all over because this asset will be abandoned. it would cause me a waste of time.

    Thanks!
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    What kind of demo scenes would you like to see? The package already comes with quite a lot (plus many extras in the media packs).

    There is a demo scene showing how to move along the surface of a planet with dynamic LOD, as well as a scene with mouse look controls allowing you to fly close to planets from space, but landing (i.e. Flying from space to the planet) is kind of game specific so I didn't include any such code.

    SGT has been supported and received many updates over the past 3 years, so I don't imagine it'll stop any time soon ;) I'm currently working on a few feature that I'll show off real soon once I polish this demo scene up, and I have plans to enhance the planet rendering even more in the near future.
     
  39. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    My main interest is in the nebula - do you have a demo showing the volumetric nebula? I would love to see three or four of them in a scene
    If it is like clouds (on earth) then it is worth the sale price to me.
     
  40. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Thanks for the reply; the fact that you respond is good enough for me to pick up the package and start working on it ;)

    Where do you keep these demo? On the store probably you have the link to old version? I believe the demo link has just few examples which show space effects, but I don't recall anything related to planets.
    It would be awesome if your package would include also the space to planet transition; Kerbal does something like that and I was thinking that if they did it, there must be a way to do something similar.

    Space to planet surface is game specific, although I believe that the second thing that people do, after flying in space with a ship, is to try to land on planets, so I think that it would be a welcome add-on (it does not have to be in the same package; it is hard work...I tried to implement it and had to give up the idea of seamless transition; replacing the approach with a flyby through clouds, while I replace the geometry of the space scene with the ground scene).

    Thanks, you've got another customer ;)
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Here's a demo of the nebula feature.

    It only has one there, but there's no difference between one and multiple.

    Keep in mind this isn't a cloud system that you can use to place stuff over your terrain, as it's only designed to look good in space. The main difference between this nebula system and a cloud system is that clouds usually require alpha blending with sorted particles, as well as shadow casting. However, for space scenes you can get away with additive blending and thus have unsorted particles, which give you much higher performance.


    The demo scenes are included in the package (you can see the file listing on the asset store page), as well as in the (currently 4) free packs you can get from the first post in this thread. The compilation demo just includes some of the best demo scenes, and in order to keep file size down it doesn't include any that have massive textures (e.g. the planet demos).

    Using the SgtDisplacedTerrain component you can create planets that increase in detail as you approach them, and in the 'Displaced Terrain' demo scene you can see this demonstrated using a basic free flight script, but to make it anything like kerbal you would need some kind of spaceship simulation code to handle this approach, which I have no plans to write. Perhaps I could write a simple spaceship controller script in a future version, but it will not be anything even 1% of what kerbal does.
     
  42. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Very nice - this shader coded or is it c#?
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    It's written in cg (similar to C), like all the shaders in this package.
     
    Mazak likes this.
  44. creepi

    creepi

    Joined:
    Nov 10, 2015
    Posts:
    34
    Hello,
    i have a little problem/bug with this Toolkit.
    After build i dont see the planet. In the editor i see it.
    Now i have try to locate the problem and found it is with the mesh.
    I try it with the original scene so i dont making wrong at new create and setting.....

    just4fun, use AlienWorldsPack => Examples => Green Barren.
    Build => no planet
    When i delete from the planet "Sgt Displaced Mesh Script" and set Mesh from Geosphere40 (Displaced) to Geosphere40 i see after build the planet.
    So i think the problem / bug is in the Sgt Displaced Mesh Script?
    I dont understand why the planet is not visible after build :/

    And, i become error from the Shader. "Hidden/SgtAtmosphereOuter" Too many math instruction for SM2.0.... i have after google... and a hour later try set pragma target to 3.0 (i dont know the position for it but now... it build without the error so i think it is work.)

    But, why dont see the planet?
    Have the Sgt Displaced Mesh Script a bug or dont work good with the new Unity3d version?

    Hope understand my problem and sry for my bad english.
    but i think before i vote this asset, i try contact for help...

    thanks.
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Thanks for reporting these issues. I've sent you a new version which should fix them all.

    I'll submit it later today and it should go live on the store sometime soon. If anyone else needs these fixes now then please send me a message or email.
     
  46. creepi

    creepi

    Joined:
    Nov 10, 2015
    Posts:
    34
    realy nice, thank you for the fast replay, it works now, thx :)
     
  47. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    I'm struggling with an issue on the warp effect on the infinite star field, I wonder if you have any ideas? I observed the issue in my own game, but reproduced it in one of your demo scenes so that you can easily reproduce it yourself.

    * Open the scene "Flying on Terrain"
    * Disable the "Sgt Snap To Terrain" component.
    * On the entity "Background Stars Big", enable "Stretch to Observers"
    * Now fly out into space
    * Observe a flickering effect on the warping stars.

    I have this same flickering when I try to use the warping stars in my game. Any ideas what's causing this effect and how I might fix it? Thanks for your help in advance!

    PS I love this package and have really enjoyed it so far.
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    In this scene the camera is snapped to the flying box which is moved using physics, this means the camera's position is updated every FixedStep (50 times a second). So every frame that's rendered between these physics updates registers as 0 camera movement, thus the stars stop stretching, then they stretch when it moves, etc, causing it to flicker.

    To fix this, just enable 'Interpolate' on the rigidbody that the camera is following.
     
    boinst2 likes this.
  49. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    That explains everything! Cheers!
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413

    This is a sneak peek of version 3.1.5, which comes with a more advanced dynamic LOD terrain system. Previously, everything was part of the SgtDisplacedTerrain component, not giving you much flexibility unless you knew a lot about programming. I've now made it so the LOD generation system uses a sort of modifier/mutator system, where you can stack a bunch of different components to change the look of your planets how you like (similar to how kerbal works).

    In the above screenshot you can see how the SgtTerrainCylindrical component can be used to generate a planet that uses cylindrical (equirectangular) projection, which can make it much easier for you to get planets up and running as you don't have to worry about creating 6 textures for everything.

    You can also see the SgtTerrainDisplacer component, which basically does the same as what the old SgtDisplacedTerrain component did, which is displace the planet's vertices using a heightmap.

    You can also see the SgtTerrainSimplex component, which allows you to displace the planet using simplex noise, and you can stack these components to create multi octave noise.

    In the future I plan to expand this system to include components that can handle spawning of trees, rocks, etc, and maybe even one that generates the actual surface textures?
     
    Last edited: Nov 13, 2015
    Cliftonm and boinst2 like this.