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. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Thanks, I'm taking a look at it now.


    You could add a colour value alongside the penumbra one and multiply it with the lighting colour (though this means you would have to modify the ring class and inspector a bit). I think I originally did it this way due to shader instruction limits, but I'm not sure.
     
  2. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    when I disable the clouds in the inspector (earth,venus..) I can't enable them back( They are not displayed anymore). I have to close and reopen my scene(without saving, otherwise my clouds are gone forever!). Is this a known issue? (I use Unity 4.6 on Windows 7 64Bit ,ATI)
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I just tested it in Unity 3.5.7 and 4.6b17 and it works fine for me. Just keep in mind that when disabling clouds the Clouds > Mesh and Clouds > Texture fields get set to null, so if you enable the cloud layer again you need to set these two values again. This was done to prevent unused mesh and texture references from bogging down your final build size, but I can certainly see why it might be an issue for some projects.

    If you want to disable clouds without losing these values then the easiest method is to comment out line 1 of SpaceGraphicsToolkit/Required/Scripts/Library/SGT_Helper.cs (which should reveal the cloud layer GameObject in the hierarchy), and then manually hide the desired layers.

    This kind of issue won't exist in SGT3 due to the changes I've made to the inspector and GameObject setup.
     
  4. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Good to know. Thanks for the info!
     
  5. failman

    failman

    Joined:
    Sep 11, 2014
    Posts:
    23
    Hi there! First of all, thanks for these amazing assets. Very beautiful and easy to use!

    I have a question regarding the alpha channel of the corona textures. I wrote a small script that uses the "ReadPixels" function to take gameplay screenshots. The background in these screenshots should be clear (zero opacity). I achieved that by setting MainCamera's solid color alpha to zero. I've also zerode out the coronas alpha channel. But the problem is that the coronas color seems to mixed up with the camera's solid colour somehow. Any thought on how can I fix that? Thanks! exm.png
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    It looks like an issue with the premultiplied alpha code. Try:

    1 - open SpaceGraphicsToolkit/Required/Shaders/CGInclude/Corona.cginc

    2 - Replace line 5 with: float4 coronaColour;

    3 - Replace line 98 with: corona *= coronaColour * opacity;

    4 - Reimport the directory: SpaceGraphicsToolkit/Required/Shaders/Resources/Corona

    This should cause the alpha to be written correctly.
     
  7. failman

    failman

    Joined:
    Sep 11, 2014
    Posts:
    23
    Thanks! I'll try that and write back as soon as I get to my PC.
     
  8. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    Are we getting close to the next release? Looking forward to being able to add atmosphere components to my own planets. As you had mentioned this would be added.

    I was also wondering a bit more about these, will the fog option work with this? Being able to have a fog covering up distant surface features is one of the main things I have missed about not using your surface generation.



    So while the atmospheres look great, I do not get any surface scattering.

    Also does the fog give any performance boost?

    Also, it is on my wish list, but not expected in the near future. Procedural volumetric clouds that become flat textures when you are at a distance.


    Love all your work so far though!
     
  9. Alphalpha

    Alphalpha

    Joined:
    Oct 9, 2013
    Posts:
    74
    Those are some nice looking planets, did you use another asset to generate those?
     
  10. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    Yes, I generate the planets separately, which is why I am looking forward to him releasing a feature that allows me to add atmospheres to planets without having his built in planet component.
     
  11. failman

    failman

    Joined:
    Sep 11, 2014
    Posts:
    23
    Yep! Problem solved. Thanks!
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Yes, I'm currently doing a lot of work on SGT3, and progress is going really well. I estimate I'll have it ready in less than a month, but if you need planet atmospheres quickly or want to test it then I can send you an advance copy?

    Fog doesn't increase performance, because it's simply applied on top of the pixel calculations. If you're talking about the fog setting on SGT planets then it's essentially a free feature, because it just modifies the atmosphere optical depth value that already needs to be passed.

    Improving the clouds and water is on my list of things to do, but for the first release of SGT3 I want to begin with improving the existing SGT2 functionality.
     
  13. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406

    Hey guys, work on SGT Version 3 is going really well. Here's a preview of one of the new features that has been requested:



    The warp drive effect! This feature works with all the new starfield types, so if you generate a cool starfield you can then travel around it with this motion blur like effect. It also works on the new wrapping infinite starfield feature.
     
  14. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Beautiful !
     
  15. Anaes

    Anaes

    Joined:
    Mar 21, 2013
    Posts:
    7
    This is really promising. Cant wait to get my hands on the new release. Im also interested in the atmosphere-only ability.
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406

    Hey guys, here's another sneak peak of a previously requested feature that will be available in SGT3!

     
  17. Deleted User

    Deleted User

    Guest

    Awesome!Does it work with Unity Free?
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Nope, this uses a post processing shader, so it's pro only (currently the only feature that requires pro). But there is an accretion disc component that allows you to make black hole stuff without screen distortion like this.

    I also plan to make a slightly different warp effect that works in free, something like in geometry wars.
     
  19. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Is there a way to adjust the star field blend mode?

    EDIT: Found it in the star field shader.
     
    Last edited: Oct 12, 2014
  20. nburlock

    nburlock

    Joined:
    Apr 11, 2013
    Posts:
    65
    I need to be able to change the day texture used by SGT_GasGiant at runtime, but it's not working. I can set the texture to a new value, and it shows the correct texture in the inspector, but the app continues to render the gas giant using the texture assigned while editing.

    How do I change the texture for SGT_GasGiant?

    Edit: I'm assigning a value to AtmosphereTextureDay in code. If I drag a texture into the inspector for that field, it works, but in code it has no effect.
     
    Last edited: Oct 12, 2014
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Interesting, I'm away from the PC for the next day or two so I can't check, but as soon as I get back I'll see if I can find the issue! If you're interested I can also give you an early copy of SGT3 which has a much higher performance gas giant shader, and doesn't have this issue.
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I had a look at the code and I can't see any fault. Nothing special happens when you assign the day texture, and the texture is constantly copied to the gas giant material in LateUpdate, so maybe you have conflicting scripts or some other issue. What happens if you look at the gas giant material in the inspector? (you will need to uncomment line 2 of the SGT_Helper.cs to see this.
     
  23. nburlock

    nburlock

    Joined:
    Apr 11, 2013
    Posts:
    65
    I have no idea what caused it, but it started working after I restarted Unity earlier today. Very weird.
     
  24. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Congrats on 3.0!

    *kicking myself for not buying yesterday* :rolleyes:

    Can we change the texture on the new Spacetime Warping? That feature is SWEEET! How did you know I needed that?
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Thanks.

    Yes, you can change the texture. There are also two warp modes: In the screenshot you can see the offset mode where spacetime is pushed away by the gravitational wells, but there's also the pinch mode where the spacetime is pulled toward the well, allowing you to create a Geometry Wars style bomb effect (and there's an example scene showing that off too).

    I didn't expect it to get accepted this quickly so I still need to finish preparing the new OP and such.
     
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406

    SGT3 has been completely rewritten from scratch to take advantage of the new features in Unity 4.x+. In order to not break everyone's projects, I've changed the class prefix from SGT_ to Sgt, so you should be able to update your installs without issue. But please, back up just in case!

    Besides the massively improved code, simplified shader loading, and updated inspectors. You'll notice there have been some new features added:

    • Black Holes (Pro Only)
    • Warping Starfields
    • Accretion discs
    • Spiral galaxy starfields
    • Faster surface tessellator (now called Terrain)
    • Infinitely scrolling 2D & 3D starfields
    • Spacetime warping
    • Separated atmosphere shaders
    • Improved atmosphere blending
    • Improved shadows
    • Multiple lights and shadows (limits depend on shader)
    • Faster Gas Giant rendering
    • Removed ring triangulation distortion
    • Improved ring draw order sorting
    • Asteroid Ring/Starfields now use sprites, allowing for simpler atlas usage
    • Nebulas no longer have particle limits
    • Tons of minor tweaks

    Keep in mind that this is the first release for version 3, so it will take some time to bring all the features back up to where they were in version 2. The main thing you may notice is that there are less example scenes that there were before, this was intentionally done to reduce download and import times (especially when changing platforms). I plan to remake most of the useful SGT 2 demo scenes and release them as a separate (free) package that you can optionally import, so don't worry about not having all the solar system bodies yet, they will be back soon. There are also a few features that I didn't get around to implementing again, for example: thrusters, volumetric probe, snap to surface, surface displacer. These will also come back soon!

    Thanks for your patience everyone, hopefully you'll all like the update. As always, let me know if you come across any issues, and good luck with your projects!
     
    trudeaudm likes this.
  27. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    Wooo! Nice work!
     
  28. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    I also want to express my apreciation. I'm curious to play around with it. Kudos and thanks for your efforts.
     
  29. failman

    failman

    Joined:
    Sep 11, 2014
    Posts:
    23
    Amazing work! I love the new "black hole" effect and how the nebulas generate, however I don't see much nebula textures in the new 3.0 version (in fact I see only one "Spriral"). Will they be added in the newer versions soon? Thanks!
     
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Yeah, I removed lots of example media to keep the file size down. I plan to release a galaxy demo pack, nebula demo pack, and several others which will include all the old media, as well as some new stuff. If you go to the end of the first post in this topic you can see I added a solar system pack. I didn't announce it yet though because the planets make use of some settings found in SGT 3.0.1 which is still pending review. You can also see a picture of a spiral galaxy that will be part of the galaxy pack. I expect to have these released within a week or two, stay tuned!
     
  31. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Fantastic work. Need to get this working in an old project now and play with it.
     
  32. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    Is there any way to set the atmosphere up to work on a terrain with LoD levels? For instance if I have a quad sphere I can place each of the sides into the atmosphere surface mesh, but then when mesh division happens due to LoD the atmosphere no longer has the reference.
     
  33. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Looks like you removed the thruster/space ship movement related stuff in the new version... that stuff is useful..

    Other than that ...I like the stuff you added/improved ..

    Good thing I saved the previous version of this asset..
     
  34. trudeaudm

    trudeaudm

    Joined:
    Apr 17, 2013
    Posts:
    116
    If you had read the release notes you would have known he is going to add them back in...
     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    To apply the atmosphere to a dynamic terrain like this you need to write a little script to glue them together. If you look at the SgtCorona or SgtAtmosphere code you'll see there's a public property called 'InnerMaterial', this will always return the current material instance used by the corona or atmosphere. The reason why I didn't make applying the material automatic is because checking to see if there are any child renderers is very very slow, especially if you have a complex terrain. If you take a look at the SgtTerrain implementation you'll see that the material is only applied when it changes, or when new terrain patches are created, making it very efficient. If you just want to quickly apply the shader to all renderers then make a simple script that does something like:

    Code (csharp):
    1. using UnityEngine;
    2.  
    3. // This component will automatically fill the target corona or atmosphere with all the renderers under this GO
    4. public class SgtCoronaGlue : MonoBehaviour
    5. {
    6.     public SgtCorona Corona;
    7.  
    8.     protected virtual void Update()
    9.     {
    10.         if (Corona != null)
    11.         {
    12.             Corona.InnerRenderers.Clear();
    13.             Corona.InnerRenderers.AddRange(GetComponentsInChildren<MeshRenderer>(false));
    14.         }
    15.     }
    16. }
    NOTE: Watch out for it applying the atmosphere to renderers you don't want it applied to.


    This will be added back soon. I plan to improve the implementation of it so I need to think up ways to improve it etc, and I wanted to release the current features as soon as possible.
     
  36. justinpark01

    justinpark01

    Joined:
    Jul 15, 2014
    Posts:
    4
    Hey first off, congrats on the new release! Awesome!

    Secondly, I can't help but notice the massive decrease in size of the package, like 85%! Is there a list of things taken out? For example, my favorite scene "SolarSystem.unity" is no longer there. Thanks
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    The file size reduction is to speed up importing times.

    You can get the solar system bodies at the bottom of the the first post in this topic, though there is no scene of the complete solar system yet.

    I'm still working on the rest of the scenes.
     
  38. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    What did you use to make those planets?(what program or asset?) ... only program I have is L3DT ...and its limited..
    Yeah sorry, my bad I didn't read release notes... was pretty busy at the time...and didn't bother later when I had time.
     
  39. justinpark01

    justinpark01

    Joined:
    Jul 15, 2014
    Posts:
    4
    Thanks for the super fast response! That package still doesn't have all of the cubed textures, cubed normals, etc.. maybe they aren't needed anymore. Guess I'll finish reading the documentation. Keep up the good work!
     
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I didn't include the cube textures because you can make them yourself using the new 'Extract Cubemap' feature I added to the CubeMap's context menu. You can read a bit more about it in the 'Creating Cube Textures.pdf' found in SGT 3.0.1. From what I can see the only missing texture is the variant of the Earth's day texture, which I could include, but I don't think it looks very good.
     
  41. looneygeorge

    looneygeorge

    Joined:
    Apr 21, 2013
    Posts:
    2
    Hi!

    Just bought SGT and its very interesting to dig through! I am however having trouble trying to set up an atmosphere for a planet I made myself. I tried to dig through some documentation but to no avail, any chance you could quickly list the way you'd set up your atmosphere with scattering on a "custom" body ? :)

    Thankyou!
     
  42. justinpark01

    justinpark01

    Joined:
    Jul 15, 2014
    Posts:
    4
    I've been going back and forth making comparisons all day and there seems be to some script functionality missing as well. For example, the RepelBodies code is missing, move on different planes with keys, and changes to SimpleOrbit. You need the line
    Angle = (Angle + (DegreesPerSecond * Time.deltaTime)) % 360.0f; in your update() or Angle will eventually blow up.

    I understand that the update is backwards compatible and I don't want to be overly critical because this is a great package, I just want to bring some of these things to your attention in case they were overlooked.
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    If you have a planet GameObject that needs an atmosphere, just add the SgtAtmosphere component to it, and drag and drop any MeshRenderers into the InnerRenderers list. You then just need to play with all the atmosphere settings until it works how you like (take a look at the Solar System Pack in the first post to see how you might change them for different styles of planets). I'll be making a video tutorial covering this stuff soon.

    Indeed, there are many random scripts and media missing, but they will all be coming back soon. As for the angle, what do you mean blow up? It will exceed -+360, but I don't see a reason why this would be an issue (besides floating point issues at extreme values).
     
  44. looneygeorge

    looneygeorge

    Joined:
    Apr 21, 2013
    Posts:
    2
    Thanks- this is however what I feel I have been doing. I have a cubemap planet comprised of 6 MeshRenderers for the different parts of the Mesh body. When I add these to InnerRenderers the whole planet turns white. When I press play I get no errors and the planet appears normal, but still with no atmosphere.
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    Did you add something to the OuterMeshes list? For example the provided Geosphere40 mesh. If so, make sure the InnerMeshRadius and OuterMeshRadius values are set up correctly. The provided Geosphere40 mesh has a radius of 1.0 unit, so the default values should work fine, but for custom meshes you should check that. You can also check the sizes of the bottom and top of the atmosphere as SGT sees it in the scene view. You should see a white circle around the curface, and another somewhere above it.
     
  46. Deleted User

    Deleted User

    Guest

    Hi.
    I have some objects in hierarchy that are created by SGT,i'd like to:
    1) Hide them. How to do that?
    2) Delete them when i create new scene,because these packs of gameobjects with scripts travels from one scene to another, even if i create a new one.
     

    Attached Files:

    • 6.PNG
      6.PNG
      File size:
      13.7 KB
      Views:
      863
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    To hide them:

    1 - Open Space Graphics Toolkit/Scripts/Library/SgtComponentPool, and replace line 255 with: root.hideFlags = HideFlags.HideAndDontSave;

    2 - Open Space Graphics Toolkit/Scripts/Library/SgtObjectPool, and replace line 272 with: root.hideFlags = HideFlags.HideAndDontSave;

    To prevent them from crossing scenes:

    1 - Open Space Graphics Toolkit/Scripts/Library/SgtComponentPool, and delete line 257

    2 - Open Space Graphics Toolkit/Scripts/Library/SgtObjectPool, and delete line 274

    In the next version I'll add an option to hide them.
     
  48. Deleted User

    Deleted User

    Guest

    Thanks,and also it's really hard to find now where is each component,this is a helluva adventure and some components are lacking functionality.
    Starfield for example,it's sepated into a lot of components,plus it's missing such properties as "pulse max,min radius" so stars can't be animated.
     
  49. Deleted User

    Deleted User

    Guest

    It didn't help.
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,406
    I separated the starfield and asteroid components because in the earlier versions adding new distribution types was difficult. I think the code is much cleaner now, and it allows for users to easily make their own distributions without digging through the massive starfield class that was in SGT2.

    I wasn't sure if anyone found the pulsing useful so I didn't add it back in, but I guess I was wrong. I'll put it back in for the next update.


    In both classes you should see the Update method at line 13 & 17:

    Code (csharp):
    1.     protected virtual void Update()
    2.     {
    3.         Count = Pool.Count;
    4.     }
    try replacing it with:

    Code (csharp):
    1.     protected virtual void Update()
    2.     {
    3.         Count = Pool.Count;
    4.      
    5.         if (Application.isPlaying == false)
    6.         {
    7.             SgtHelper.Destroy(gameObject);
    8.         }
    9.     }