Search Unity

Space Graphics Toolkit & Planets

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

  1. QuantumSingularity

    QuantumSingularity

    Joined:
    Apr 13, 2015
    Posts:
    1
    How to you add mesh colliders to Terrain? I am creating a planet for a character to walk around on, and a sphere collider does not work so well.
     
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    The SgtTerrain component has the 'Max Collider Depth' setting, you need to set this to at least 1 to generate Mesh Colliders.
     
  3. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    Can I create asteroid fields using mesh prefabs or is this based on using sprites for the asteroid fields?
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    The SgtBelt and related components generate billboard asteroids that are textured by the MainTex and HeightTex fields, so no you can't specify a mesh or prefab.
     
  5. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    Would that be a easy thing to switch out in your code? Or are the sprite quite dependent on it. Searching for a fast way to generate real asteroid fields with actual meshes.
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    This would require extensive changes to the SgtBelt class and shader and completely change the way it works. Right now it's just designed to render thousands of billboard asteroids that orbit with little overhead.

    The best solution would be an alternative to SgtBelt that uses prefabs, perhaps spawning them as the camera approaches. However, such a component is difficult to design in a way that runs fast and is flexible enough for most games.
     
    neoshaman likes this.
  7. GhulamJewel

    GhulamJewel

    Joined:
    May 23, 2014
    Posts:
    351
    upload_2017-1-26_22-56-26.png

    I noticed some of the samples scenes have missing textures for example the milky way and nebula scenes. They all have their main textures and cloud textures missing. Now which textures go where and how to sit it up so the clouds appear like in the picture of that milky way :):):p
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    That's the 'Galaxy Pack/Milky Way' demo scene. The clouds are generated from the 'Milky Way Clouds' GameObject, which references the 'Galaxy Pack/Textures/Milky Way' texture, and the 'Basic Pack/Textures/Clouds (2x2)' texture. I notice the clouds are very small, so you must increase the 'Star Radius Max' setting to get the same result as that screenshot, but the media otherwise seems fine.
     
    GhulamJewel likes this.
  9. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Hi Darkcoder,

    I am writing to ask for some advice with SGT for a particular situation.

    In my game, I am rendering the player and planets with the main camera and I would like to render the skybox and SGT starfields with a second camera. The main camera has the clear flags: "Depth only" with a Depth of -1, while the Second camera has Clear Flags "Skybox" with a Depth of -2. The reason for this unusual setup is because the first camera has a low FOV to give the player and planets more of a 2.5D feel, while the second camera has a larger FOV so that the background skybox is not so zoomed in. I would really like to control the FOV of the second camera and have it affect both the starfield and the Skybox, but I can't figure out how to make the main camera not show the starfield and have the starfield only show in the second camera (i.e., the one with the skybox) instead.

    Maybe its something I am not doing right, and/or that I missed. Otherwise, would you know of a good way to achieve this ? Your advice would be much appreciated.

    Thanks so much!
     
  10. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    336
    Darkcoder i think you are doing a great job in updating your asset!
    i have tried your online demo, and it was exciting!

    but have you checked other tools such as proland? it's very advanced tool, it went open source like few years ago!
    and i strongly believe that upcoming major games like "star citizen" which takes space exploration to next level is using this library to fullest! (after many video/demo examinations)

    i think your tool is great as it now (very amazing), but i think many devs are thinking whats the next big thing in space exploration! no man sky, star citizen, what's next? these games are able to render space from far distance from a planet, to the very details of a character standing on it's surface!

    i bet many devs will delve in such projects, and they will need new assets to fill such requirements in space exploration! i think this is a major opportunity for you since you are interested in developing such assets for unity!

    if am not obvious enough, maybe it's time to roll up your sleeves and think of new next gen asset!! :)

    keep it up~
     
    Last edited: Jan 28, 2017
  11. Darkcoder

    Darkcoder

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

    This sounds like a completely normal scenario, it just sounds like you just didn't set the layers up? For example you might want to add a custom layer called 'Background', and assign all background GameObjects to that, and set the background camera's CullingMask to only render this 'Background' layer, and remove that layer from the main camera. It should now render exactly as you expect.


    Thanks, the next update will add many nice visual features, as well as much improved demo scenes.

    I've experimented with the terrain a lot, and one of the biggest limitations I've encountered is just how slow Unity's Mesh class is. These impressive planets in Star Citizen, Space Engine, etc, are not just down to awesome multi-threaded code, but also the speed of the APIs they use to generate the visuals.

    Rendering of small and large objects is no issue though. In one of the previous pages I demonstrated such a feature with multiple cameras, it just requires a lot of care with scene setup and an understanding of how it works.
     
    Django likes this.
  12. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    336
    thanks for replay!
    am interested in seeing your visual enhancements!
    i know games like star citizen invests in post processing to make graphics amazing, i wish you could nail the graphical quality look of their game, i don't think you should have any limitations with unity.

    in regards of terrain complexity in unity, i understood what you said..
    am sure unity devs are putting such requirements in their long term agenda (improve engine mesh creation etc)

    after a year am planning to do a new game about space combat, that sometimes requires player to fly near planet surface and engage against ground enemies... so i hope by then i see your asset really improved by then.

    keep it up
     
  13. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Carlos, you are the best!

    Before I wrote to you, I had setup a background layer and assigned it to the starfield, but the starfield wasn't showing up in the second camera. Turns out that there were two problems First, my background camera had a really tiny value in "Far Clipping Planes" so the skybox would show but not the background objects and the starfield. Second, for some reason the starfield had its render queue set to Geometry but I changed it to Transparent.

    Everything renders perfectly now! Thanks again.
     
    Darkcoder likes this.
  14. ninjafredde

    ninjafredde

    Joined:
    Oct 2, 2014
    Posts:
    2
    Hi Carlos and thank you for your excellent Space Graphics Toolkit!

    I have a question regarding SgtAtmosphere and a custom planet shader I've been writing.

    With any standard shader, sgt atmosphere renders perfectly as it should (lower part of shaderIssue.png) for reference.

    The planet shader I'm writing is using GPU noise and displacement (http://briansharpe.wordpress.com) . No atmosphere renders and it seems to make no difference where I put SgtAtmosphere in the render queue offset. It's as if any vertex modification in the shader renders on top of everything else.

    I've been searching for a solution for a while now and was wondering if you or anyone else here had any brilliant insight.
    /Fred
     

    Attached Files:

  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    SgtAtmosphere can only correctly render on top of other shaders if they output the same vertex positions, i.e. transform the local vertices using the normal MVP matrix. If your shader displaces the vertices using noise or something else then these vertices will no longer match, and thus the atmosphere effect won't be able to align properly. To fix this you need to either: make the same vertex position modifications in the SgtAtmosphere shader, or copy and paste the atmosphere shader code into your shader and combine them. The former is easier to do, but it requires modifying SgtAtmosphere (especially if you don't want the changes to break all other atmospheres), or ideally you could subclass it into SgtAtmosphere2 : SgtAtmosphere or something, and just override the shader name property to your custom one.
     
  16. ninjafredde

    ninjafredde

    Joined:
    Oct 2, 2014
    Posts:
    2
    Thank you for responding so quickly.
    I understand, I think I'll go back to generating the noise on CPU side (it isn't really necessary on GPU since it won't change after being generated, although it's really fast and very detailed).

    It will also be easier later as I'm planning to use the cpu side noise height for simple "collision" checking
    Again, thanks for the reply and great work
    /F
     
    Darkcoder likes this.
  17. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    Just wondering when these warnings will be cleared?

    Assets/Space Graphics Toolkit/Examples/Basic Pack/Scripts/SgtHideWireframe.cs(28,30): warning CS0618: `UnityEditor.EditorUtility.SetSelectedWireframeHidden(UnityEngine.Renderer, bool)' is obsolete: `Use EditorUtility.SetSelectedRenderState'

    Assets/Space Graphics Toolkit/Examples/Basic Pack/Scripts/SgtHideWireframe.cs(38,30): warning CS0618: `UnityEditor.EditorUtility.SetSelectedWireframeHidden(UnityEngine.Renderer, bool)' is obsolete: `Use EditorUtility.SetSelectedRenderState'

    etc.

    Using Unity 5.5

    Thanks
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    You can just comment out those lines if you want to stick with SGT 3.2.4. They will officially be fixed as soon as I finish the next version though, which will be this week (no idea how long it will take for the submission to get approved though).
     
  19. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    No problem I'll wait for the update thank you.
     
  20. Deleted User

    Deleted User

    Guest

    Lord Darkcorder!

    Hi! I love the SGT toolkit! Really impressed! Quick question, is there a way to exchange out the Big Asteroid prefab within the infinite asteroid spawner with one of my one prefabs? I've been messing around with it for about an hour, and no luck thus far! Thank you thank you, sir :D
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Yes, you just need to add the 'SgtDebris' component to your prefab, then you can add the prefab to the 'Prefabs' list in the SgtDebrisSpawner.
     
  22. MalachiteBR

    MalachiteBR

    Joined:
    Jun 21, 2013
    Posts:
    22
    First of all, this asset is one of the best and if Im not mistaken it was the first asset that I bought.. it was an instant buy...keep up the great work!!

    I tried every configuration and didnt come any closer to that image of galaxy. The planets seems to be fine, but my spiral galaxies are kinda ugly and too bright to my taste :(

    Can you help me out ?
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Try the attached scene, it should provide a result very similar to the picture.

    The tricky part about galaxy brightness is that the dust particles use additive blending, so when viewed side-on, the particles all stack up and get very bright very quickly. This is where the 'Horizontal Brightness' and 'Horizontal Power' settings come in, which must be tweaked based on the particular dust clouds and the look you want.
     

    Attached Files:

  24. Monarky

    Monarky

    Joined:
    Oct 2, 2010
    Posts:
    35
    Just thought I would drop an idea. It would be really cool to see procedural voxel asteroids. Been looking for a package to do that. Don't really want the terrain just want asteroids that i can eat away at and place minerals inside. Love your package.
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    It's probably too much work for such a small feature. There are packages out there that do voxel destruction like you mention, and they have been in development for years. Sure, the packages I mention are for full terrains, and not just small asteroids, but the core code behind that is mostly the same.

    That's not to say I won't experiment with it in the future though, as I have some prototype code lying around that does something like this, and assuming no LOD, one material, single thread, then the code may not be so difficult, but we'll see. My priority right now is getting the core package up to date and improving the tutorials :)
     
  26. MalachiteBR

    MalachiteBR

    Joined:
    Jun 21, 2013
    Posts:
    22
    Thank you so very much, it did the trick ;)

    Ill experiment more on those settings.
     
    Darkcoder likes this.
  27. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Hey Carlos,
    just have seen the the new 3.3 release and want to express my apreciation that you constantly improve and update SGT. This is definitely one of my top 3 purchases from the Asset Store. Just want to say thanks and keep up the good work.
    Regards.
    Henry
     
    chelnok likes this.
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Thanks, I didn't expect it to go up so quickly though! Time to update those media packs :D
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    The media packs have now been updated! You can get them from the same links in the first post, or from my website.

    SGT 3.3.0 mostly changed the planet and star features, so here's a comparison between the old and new Solar System Pack.

    OLD:

    NEW:

    As you can see, the new shader and component settings give you much more control, and allow you to get much more accurate results. Most of the scenes in this pack were created alongside real life space imagery, so if you google for the real-life pictures, you can see just how accurate some of these are (there were conflicting images of Mars and Earth though, so they may differ). Enjoy!
     
    Last edited: Feb 20, 2017
    Artaani, Inspeinre, hopeful and 2 others like this.
  30. Eric-Hackathorn

    Eric-Hackathorn

    Joined:
    Nov 22, 2013
    Posts:
    18
    Is 3.3 live yet? I just tried downloading and got a fresh copy of 3.2.4.
     
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Will the old flares be kept along with the new ones? I'm partial to one of the old ones. :)
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    You need at least Unity 5.5.0 to download it.


    The old packs or SgtThruster flares? You can download the old packs from HERE, I can add an extra component to get the old thruster flares though.
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    I was thinking specifically of a sun flare that I had picked to use in part of my game. I was wondering if it would be kept in an archive somewhere, or still in the kit (they don't take much room), or if I'd need to try to keep track of it in an archive of my own (if I still have it somewhere, and I think I do).

    Generally, I like the idea of an archive being kept somewhere, so that older art isn't completely lost.
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hmm, I'm not sure what you mean by sun flare. The latest asset packs are updated to use the latest SGT features, but they should look more or less the same as before (just more realistic). Similarly, the demo scenes that come with SGT (Basic Pack) were updated to be a bit more impressive, but they should still look very similar. For example, the 'Star' and 'Supernova' scenes show different star flare techniques, and use the same media since SGT3 (or maybe even SGT2), so I don't think I removed anything.

    If you have a screenshot that shows otherwise then I'll happily add it back in though. I agree that losing demo scenes and media is bad, which is why I try to maintain the scenes as long as possible, and I usually only remove them if I've rewritten a feature to the point where the scene can be made in a better way (e.g. the Gas Giant demo scene). The current 3.3.0 build temporarily removes a few demo scenes, because I need to finish up some extra code to get them looking as good as the other scenes, but these aren't related with stars or flares.
     
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Ah, okay. It's been over half a year since I last looked into SGT, and I wasn't remembering properly. I think what I was liking was actually the prominence texture, with it looking more like the OLD sun on the left of the shot. Probably all of these suns, new and old, are using the same prominence, just with different settings ...?

    (In a different space scene I was using a few flares with a sun to get a cool sunrise-over-planetary surface effect, and I was confusing the two things.)
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Yeah, the prominence texture hasn't changed since I originally added the feature. I should really make some more :D
     
    hopeful likes this.
  37. Eric-Hackathorn

    Eric-Hackathorn

    Joined:
    Nov 22, 2013
    Posts:
    18
    That did the trick, thanks! BTW, if you delete the examples directory you're left with a missing reference to SgtDepthTextureMode.
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Nice find, I'll move that to the main scripts directory!
     
  39. Eric-Hackathorn

    Eric-Hackathorn

    Joined:
    Nov 22, 2013
    Posts:
    18
    Actually, there are several scripts under Basic Pack / Scripts that might be better off in the main scripts directory. SgtSimpleOrbit for example. Nice work BTW!
     
    Darkcoder likes this.
  40. XeyosUDN

    XeyosUDN

    Joined:
    Jun 21, 2013
    Posts:
    14
    So you are planning to add in the future also the way to more effectively create the stars as their true 3D objects? I do not know as parameters to change its color according to temperature or brightness according to magnitude. So you can create stars at runtime and not as prefab.
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Can you elaborate on what you mean by 'true 3D objects'? In the current build and demo scenes you can create stars that are 3D spheres (or ellipsoids), have a volumetric corona (via SgtAtmosphere), and have 3D prominences (via SgtProminence).

    There's no feature to color the stars based on temperature or size based on magnitude, mainly because I like the current system where you have full control over the colors and density to create whatever you like, realistic or not. You can create stars at runtime that have this ability if you write a basic script to do so though. I temporarily removed the example scene that shows this in action, but the code required is basically the same as what's described in the 'C# API' documentation, and should otherwise match the steps you currently have to take in the inspector.
     
  42. GhulamJewel

    GhulamJewel

    Joined:
    May 23, 2014
    Posts:
    351
    Thanks to Space Graphics Toolkit was able to make this small project :)

     
    chelnok and Darkcoder like this.
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Great job! I like the football/soccer ball planet :)

    You should maybe make the rover wheels spin, add a subtle detail texture to the moon, and some textures to the space shuttle to make it a bit more graphically consistent.
     
    GhulamJewel likes this.
  44. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Convert this into C# and you should be all set: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/

    I use the same algorithm in my game to color stars at runtime.
     
    chelnok likes this.
  45. XeyosUDN

    XeyosUDN

    Joined:
    Jun 21, 2013
    Posts:
    14
  46. Darkcoder

    Darkcoder

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

    SGT 3.3.2 has just been released!

    It includes the new SgtAurora and related components, allowing you to create fully procedural and animated Aurora Australis/Borealis effects around your planets! Like many other components, the animation is done on the GPU, so it runs very efficiently on all devices including mobile, and has lots of settings so you can tweak the visual results to your exact requirements.



    In addition to some bug fixes, it also includes an updated 'Simple Thruster' demo scene, featuring a 3D model of a SpaceX Dragon-esque space ship.

    Enjoy!
     
  47. iLawn

    iLawn

    Joined:
    Apr 16, 2013
    Posts:
    16
    Hi All!
    Darkcoder, thanks for asset! Nice job!
    Help me figure out the scattering near the surface of the planet. In the demo scene (Terrain LOD) I do not see the effect in the render.
    Thanks before.
     
  48. Darkcoder

    Darkcoder

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

    This is what I see when entering the atmosphere:

    I plan to improve this effect soon, but it seems to work still.
     
  49. Layrider

    Layrider

    Joined:
    Dec 27, 2015
    Posts:
    1
    Hello. Very good asset - I bought it a month ago and very pleased. But I have a question - how correctly to adjust a grid of colliders on a planet with STG Tertain? Because at me the device descending on a pallet often falls through a planet. I put different parameters Max Collider Dept and 5 and 7 (as in the screenshot), but the result was the same, except that 1 did not give a sense of presence on the planet with the landscape. Sorry if there are errors - I write using Google translator, but I think the essence of my question is clear.
     

    Attached Files:

    michaljabrzyk likes this.
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,413
    Hey everyone, here's a sneak peak of SGT 3.3.4:



    I've rewritten the SgtTerrain component to be much faster than before, so fast that you can even place two terrains on top of each other (see the water layer). I've also rewritten it to eliminate seams between LOD levels using a very cool new technique, as well as improvements to the various related components!

    The terrain & water shaders obviously needs some work, and there needs to be foliage, but the improvements to the terrain and water handling should be evident from the pictures.