Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Space Graphics Toolkit

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

  1. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    193
    Amazing, can't wait to test the new version. Thx for you continuous work on this great asset!
     
    Darkcoder likes this.
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Here's a quick video showing off the new terrain demo scene, don't tell Bruce Willis!

    This demo scene makes use of the new simplified floating origin system, so there are no physics or graphical glitches up close, even when the planet (or planets) are far away. It also shows off the new SgtLightPointer component, which allows very distant point lights to still cast directional cascade shadows. It also uses the new SgtProximityDrag component, which will automatically add atmospheric drag to the current Rigidbody when it goes near planets, which also reduces LOD popping issues by slowing you down.

    This video also shows off the new terrain normal generation code, which will be included in the next version.

    I also posted it to Twitter in case anyone uses it!



    Next on the to-do list is top secret, let's just say it may be called SgtHydrosphere!
     
    Wavinator, Rowlan, joshua_42 and 4 others like this.
  3. csofranz

    csofranz

    Joined:
    Apr 29, 2017
    Posts:
    147
    That's an impressive demo! I'm currently looking for something similar, if not on quite on such an epically large scale: I'd like to make procedurally generated asteroids landable, using dynamic LOD as you demonstrate. This would mean more irregularly (within reasonable bounds) shaped objects (say each asteroid is 500m (1500ft) in diameter that I can close in to 1m without the textures breaking apart or the triangular nature of the surface becoming too obvious. Would SGT be able to support something like that?

    Thanks,
    -ch
     
  4. VikingPingvin

    VikingPingvin

    Joined:
    Jan 22, 2016
    Posts:
    7

    I just couldn't wait more. This video sold me! After stalking this project for years....
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    The greater the height displacement, the more obvious the LOD popping becomes. Here's what it would look like using the asteroid height map with some different detail textures and no atmosphere:



    I'll see if I can experiment with some kind of transition system in the vertex shader.

    You could also adjust the split distances so more of the detail gets loaded up earlier.


    Thank you! I will try to improve the store screenshots and videos too to sell more people too!
     
    Quarior likes this.
  6. VikingPingvin

    VikingPingvin

    Joined:
    Jan 22, 2016
    Posts:
    7
    And I have a question right away. So far I am enjoying everything, but i have an issue with shadows:

    Here is the effect on the promo video: https://i.imgur.com/jfutNqy.png
    And the one I get on the same scene: https://i.imgur.com/EXw494q.png

    Am I overlooking something, some settings maybe?

    Another question: Since I haven't gone deep into SGT yet, what is the general approach to casting shadows to my dynamic objects moving through space? I noticed that scene mentioned above has shadow cast turned off for the star, I tried turning it to hard shadows and making sure light range is big enough, but my object (unity cube) is completely black at all times.
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    The demo scene in the promo video is the Features/Jovian/Jovian demo scene, but it looks like you're running the Features/Ring/Planetary Ring demo scene. In the next version I will differentiate these scenes a bit more, since they show different things. While updating the code yesterday I noticed a bug with the shadow caster picking code, which might explain your missing shadows. I'll send you an early copy of the next version in a little bit which should fix this issue.
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Here's a sneak peak of the improved planetary ring shadows that will be in the next version of SGT.

    Now that I record this I notice the cloud shading and ring detail texture could be improved too. One thing at a time I guess :)

     
    emdzeyek, Quarior, hopeful and 2 others like this.
  9. tvirus06

    tvirus06

    Joined:
    Apr 21, 2013
    Posts:
    182
    Any info on that atmosphere realtime height adjustment stuffs?
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    The attached file should do what you want, let me know what you think.
     

    Attached Files:

  11. tvirus06

    tvirus06

    Joined:
    Apr 21, 2013
    Posts:
    182
    Works great, Seems good. Now people can have low atmospheres in space, and look even more real. Will this get added to the asset, if not I'll have to keep it placed somewhere so I don't loose this.

    Edit: Adjusting can be fast, but probably can be fixed with the distance values. Also if the atmosphere is to high then there is no fog on ground.
     
    Last edited: Dec 2, 2018
    hopeful likes this.
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    This will be included in one of the next versions. To adjust the ground fog make sure your 'Middle' setting is quite low. You can set this to 0 to match the behaviour of previous versions of SGT.
     
  13. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    17
    Hey there - I'm having difficulties getting shadows to work? I've followed the documentation but nothing shows, and even the demo scenes don't appear to show any shadows on rings/planets - any advice? Running Unity 2017.4.6f1. Thanks! Love the assets :)
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Which version of SGT are you using? (listed in Change log.pdf) Also, which shadows are you talking about? Unity shadows on planets, or the SgtShadowSphere/Ring system? And which types of gameObject are you trying to cast the shadows on?

    Version 3.5.8 of SGT will be out soon which fixes a few shadow issues.
     
  15. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    17
    On version 3.5.7 (downloaded yesterday). The shadows I'm referring to is planet shadows on rings, and ring shadows on planet - neither work, even in the demo scenes which is odd. Any help gratefully appreciated!
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Try updating to 3.5.8, it was just released. If it still doesn't work I'll test it in that version of Unity.



    Version 3.5.8 Out Now!

    This version features the new SgtTerrain.Normals setting. When set to QuadStep, it gives you more detailed normals than what was available in 3.5.7.

    The SgtAtmosphere component renders shadows differently so they look better, particularly at the horizon when viewed from space.

    The SgtBelt lighting code was rewritten, so it now no longer changes based on camera angle, and you now no longer need to specify an asteroid heightmap texture. These changes make it a little more expensive to render, but I think the visual improvements are worth it. I also included a new asteroid texture set based on the 3D asteroid model.

    This version also includes a lot of small tweaks and changes, but the most important one is that I fixed some scenarios where lights or shadows would disappear when the shadow caster had the same position as the show receiver.
     
  17. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    533
    Is it possible to have the Aurora on a planet surface, i. e. when I'm standing on a terrain and look up into the sky? From what I've seen you can only have it on a sphere.
     
  18. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    17
    can confirm it now works - great job!
     
    Darkcoder likes this.
  19. VikingPingvin

    VikingPingvin

    Joined:
    Jan 22, 2016
    Posts:
    7
    Can confirm as well, now planet and ring shadows work fine!

    Another issue: https://i.imgur.com/uI61yJn.png

    The small cubes look lit when far away, and only get properly dark when i get close. Any way to solve this issue?

    Also what is the proper way to make a <whatever object> revieve planet and ring shadows? Is it possible?
     
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    The SgtAurora effect is deformed to a sphere, but as long as your terrain isn't infinite in size it's possible to adjust the settings to work on top of a terrain.

    First of all, you want to set "Start Top" to 1, so all aurora paths start at the top of the sphere. Next, you want to increase the RadiusMin + RadiusMax values so they are much higher. For example, if your terrain is 1km*1km, then you may want to use a radius like 5000 and 5050. Next, you'll want to position the Aurora so it's just above your terrain. The position depends on your radius values, but for example -4500 would put it 500m above your terrain. You may need to tweak some of the other settings like reducing StartMin/Max, and reducing PathLengthMin/Max too, but it should work.

    Great!


    The SgtShadowLayer component can be added to any renderer to make it compatible with SGT shadows. It won't work well with transparent objects though, for that you would have to integrate the SGT shadows into the shader code.

    The cube lighting issue you see there is because the cubes are behind the planet, but the cube faces point toward the light and are still lit because they don't have shadow. You can fix this by increasing the last shadow cascade distance to match the distance at which they spawn, or increase the LOD depth required for the cubes to spawn so you must be closer, or add a SgtShadowSphere to your planet and an SgtShadowLayer to all the cubes (may be a bit slow).
     
    Rowlan likes this.
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Hey everyone,

    Version 3.5.9 Out Now!

    This version fixes a number of bugs with jovian and cloudsphere rendering. Adds some new settings to asteroid belts, and adds new demo scenes for asteroid belts, gas giants, planetary rings, starfields.

    If you haven't purchased SGT yet, then this is your last day to get it on sale (until midnight PST)!

    The next version will include a CPU fallback for the SgtTerrain feature, otherwise it's too annoying to test on Mac.

    If anyone has some cool ideas for new features or demo scenes then please suggest them :)
     
    Quarior likes this.
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    533
    Actually I do, now that you are asking. I'd like to use your asset on a terrain level, not in Space. Here's an example usage of the asteroids:



    Imagine above scene mount doom like, was just a quick prototype to see how it looks like. I still have to try the Aurora, which you helped me above, thank you very much for the hint. I tried to add the planets and the sun in the background, but that was all flickering. It would be really cool if that could work as well. Have to try a planetary ring as well. Also, the asteroids in the demo scene could be of higher resolution and look better. When you come closer, they look a tad ugly. The black hole would make a nice portal with a few improvements.

    Yes, I'm abusing your asset for what it's not intended if you don't mind, but I do like it :D

    sgt.jpg
     
    Last edited: Dec 7, 2018
    Cowboy_Jow and hopeful like this.
  23. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    533
    Thanks, that works quite nice. If you ever consider it, having it ribbon flat instead of a sphere would be awesome :)

    aurora.jpg
     
  24. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Looks nice! Do the planets still flicker with version 3.5.9? If so, could you record of video of it, and take a picture of your camera settings?

    To make the asteroids look better I recommend you make them smaller and increase the amount. They're billboards and designed to render quickly, so there isn't too much more I can do to improve it. I still want to experiment with them though.

    If you mean with the SgtTerrain LOD system, then there's no example for this with Earth yet. The terrain system is currently suited to making small desert or rocky planets. To make terrain suitable for Earth I need to improve the detail system more, modify the code to allow for larger planets, optimize it some more, and add an ocean rendering system. All of these features are currently being worked on and I'll post progress soon!
     
    joshua_42, SONB and ViniciusSanctus like this.
  25. ViniciusSanctus

    ViniciusSanctus

    Joined:
    Jan 23, 2016
    Posts:
    4
    Thanks a lot friend, great work on the tool!

    Glad I purchased it! =D
     
    Darkcoder likes this.
  26. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    hopeful likes this.
  27. tvirus06

    tvirus06

    Joined:
    Apr 21, 2013
    Posts:
    182
    Hey I noticed, I used black and white height maps, but now they don’t work anymore like they use too. I notice the height maps now are colored?
     
  28. Quarior

    Quarior

    Joined:
    Aug 28, 2017
    Posts:
    17
    Yes I confirm but for me I have also a normal map of my planet so I use this. You can create normal map from heightmap with GIMP if I remember.
    Rappel : Normal map is like blue texture.

    Maybe is planned the author reupload this function ?
     
  29. cybersoft

    cybersoft

    Joined:
    Feb 12, 2014
    Posts:
    75
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    They now use the alpha channel, so you can use the "Alpha 8" or "Single Channel" format, which saves memory. Are you talking about the SgtTerrain feature here?

    Good luck!
     
  31. Acet

    Acet

    Joined:
    Jun 26, 2014
    Posts:
    11
    Hi,

    First things first: really amazing, impressive package here and, certainly from my project, it makes a huge huge difference and is already resulting in far superior results in far less time than if I tried to implement the parts I need myself.

    I found a bug in the latest version on the projection of shadows using SGTShadowSphere (and SGTShadowLayer to receive it) on top of a sphere with a Standard Shader.

    Here's a picture of it:
    SGT_Bug1A.png
    The sun has a point light in it and the little planet on the left is casting a shadow on the planet on the right, however as you can see, the shadow crosses through the planet and also gets visibly cast on the other side.

    The reason why its visible is that the material on that sphere is getting environmental light from the skybox but the cast shadow is not (if I reduce the Lighting Environment Intensity to zero then the back side shadow is not noticeable anymore as that whole side of the planet darkens to black). Maybe the SGT Shadow Layer should be picking up that environment lighting?

    I've tried lightening the shadow cast via SGTShadowSphere by poking around with the Sharpness and Opacity of SGT Shadow Sphere of the planet casting the shadow but the results look buggy specifically:
    1) Sharpness values entered seem to be internaly rounded to int as seen in the color of the shadow cast, so it's either None, Full Black or one of the R,G, B, Yellow, Cyan, Purple colors at maximum intensity and saturation. If I increase the space between minimum and maximum radius the borders of the shadow do get softened but the main area is not affected at all.
    2) Changing the Opacity value does not change the opacity of the shadow itself, rather it changes the opacity of the area outside the shadow (i.e. lower opacity makes everything else darker). Here's an example picture:
    SGT_Bug1B.png
    If you look carefully you'll see that with opacity 0.2 on the SGT Shadow Sphere of the casting planet, not only is the bright side of the shadow receiver planet darkenned, but also the SGT Ring surrounding the Gas Giant in the middle.

    I reckon this is maybe not as it is supposed to be?
     
  32. Acet

    Acet

    Joined:
    Jun 26, 2014
    Posts:
    11
    Further, the planet on the right doesn't seem to cast any shadows on anything even though it's setup as the one on the left and the one on the left does cast shadows on the SGT Ring but not on the SGT Jovian in the middle :/

    On the upside, two versions ago it was the SGT Jovian that didn't cast shadows on the SGT Ring and that is now solved. Also the SGT Ring does cast shadows on the SGT Jovian just fine.
     
    Last edited: Dec 10, 2018 at 6:28 PM
  33. tvirus06

    tvirus06

    Joined:
    Apr 21, 2013
    Posts:
    182
    Yeah, using the terrain planets.
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    I just added ambient lighting code to the SgtShadowLayer, however, it won't entirely fix what you see in that scene. The issue is that the shadow layer doesn't know what the material lighting looks like under it, so there's no way for it to calculate the correct shadow color. This shadow layer system only works correctly when your ambient lighting is completely black, because then the color is known.

    To correctly support the shadow system in other materials with ambient color, the shader code must be modified so the lighting color gets multiplied by the shadow color before it's applied.

    I've now fixed the opacity setting, and added shadow culling. Most SGT shaders only support to up 2 shadows, so when you have 3 in a scene it could write the wrong 2. Shadow culling now allows the correct 2 to be written, as long as 3 aren't casting on the same object at the same time. In scenarios where more than 2 lights or shadows cast on an object, perhaps some kind of distance or radius setting needs to be factored in, but for now these changes should be good.
     
  35. Acet

    Acet

    Joined:
    Jun 26, 2014
    Posts:
    11
    Thanks for getting back so quickly on this.

    I can see what you mean with how a shadow layer won't produce a shadow which is a perfect match to the one calculated in the material of the actual planet, but hopefully and given the low ambient lighting typical in a space scene it should be more than good enough.

    With regards to the shadow culling, the thing that worries me with regards to the 2 simultaneous shadows limit is that in planets with an SGT Ring there will always be 1 occupied shadow slot on the Shadow Layer of its own planet because of the ring shadow and 1 on the Ring Shadow Layer because of the shadow of its own planet, which effectively only leaves 1 free shadow slot in each, so for example a gas giant like Saturn can only have one good shadow casting moon.

    Also, what priority are you using to choose which shadows get cast when more than 2 are required at the same time?
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    This is an issue, but in reality it's quite rare to have more than 2 prominent shadows. I may be able to extend it to 3 or 4 since I originally wrote the shadows with shader model 2 limitations, but Unity has since moved to a minimum of 2.5. I'll have to experiment.

    Currently shadows are written in order of activation/OnEnable.
     
  37. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    9
    I was having a problem with small stars flickering but i found a fix. I don't really know what i'm doing or why this works... However.... if you change the sprite texture type from "sprite" to "default" it stops flickering for me. I haven't vigorously tested this but it works in the few demos i have tried this on.
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Sprites have mip maps disabled by default, which would cause flickering like effects when you shrink them down to a size where mip maps would normally be used.

    I should probably enable this since the star textures are used for the billboard sprites too.

    I think clamping the max size of stars looks really bad up close, so using the "Near" fading is better.
     
  39. Cowboy_Jow

    Cowboy_Jow

    Joined:
    Jan 12, 2014
    Posts:
    9
    I was wondering about the "Near" feature. I remember it used to be called fade near and there was a distance setting. I can't seem to get the new checkmark to do anything no matter what i place the settings to.

    EDIT: Nevermind. I just haven't played with all the settings enough. I got it now the "Thickness" is the the distance.
     
  40. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    17
    Hi again! We're finding we get some very strange looking artifacts on PS4 Builds - are there any steps we need to take to make sure this works on PS4? PC is all fine, but this is how a jovian planet looks on PS4:

    upload_2018-12-12_9-57-11.png
    upload_2018-12-12_9-58-26.png
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    Does it look broken like this if you disable "Lit"? Also, does this happen with the latest version of SGT? Does entering the atmosphere work, or does the inside color correspond to the outer color?

    It almost looks like some kind of bug with the cubemap sampling in the shader. Perhaps try playing around with the "Main Tex" cubemap settings like the texture format.
     
  42. allornothingJM

    allornothingJM

    Joined:
    Feb 3, 2015
    Posts:
    17
    Hey, thanks for the quick reply, very much appreciated!

    Using 3.5.8 but will update and try that. No change if I disable "lit" on the object. I can't tell if entering the atmosphere works as we only use this in the (very important but non interactive) skybox
     
  43. ViniciusSanctus

    ViniciusSanctus

    Joined:
    Jan 23, 2016
    Posts:
    4
    DarkCoder friend,

    How can one change brightness and color via script on the SgtStarfieldInfinite?

    All I found was how to change the Gradient and changing brightness had no effect. I wanted to change that editor Color instead and brightness to work in RT.

    Can u help?

    Thx =D
     
    Last edited: Dec 13, 2018 at 10:17 PM
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    1,326
    You can call the .SetColor(...) method, or set the .Color property then .UpdateMaterial()