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. Dizzy-Jump

    Dizzy-Jump

    Joined:
    Oct 9, 2014
    Posts:
    12
    Thanks for the great job! It's one of the coolest unity plugin that I've ever seen.
     
    Darkcoder likes this.
  2. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Hey,

    I'm getting two weird errors when trying to compile for Windows Store Apps with an older version of SGT (2.7 I think).

    Scripts\Library\SGT_Helper.cs(2211,33): error CS1061: 'System.Type' does not contain a definition for 'GetMethod' and no extension method 'GetMethod' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    \Scripts\Library\SGT_MonoBehaviourUnique.cs(85,27): error CS1061: 'System.Type' does not contain a definition for 'GetField' and no extension method 'GetField' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

    Any idea for a workaround?

    Thanks
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Can you tell me the exact version of SGT? (Should be listed in the Change Log.pdf) as well as the exact version of Unity you're using?

    I'll test it out tomorrow when I'm at my PC.
     
  4. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    it's SGT 2.7.3 with Unity 5.2.2p2

    Many thanks!
     
  5. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Hello! Darkcoder, any chance to see other planets with atmospheres directly from other planet with atmosphere?
    Playing with RenderQueue types and Render Queue Offset - without result.

     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    To do this you need to make the atmosphere partially transparent, which can be done via editing the color gradients.

    In real life it happens because all light is additive and the stars and other stuff become too hard to see against the bright sun, but in a game that wouldn't really be possible without high precision HDR and automatic exposure changing shaders and stuff, so alpha blending is much more simple!
     
  7. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Darkcoder, Thank you for a reply!

    Ya, i know about transparency and other. But if i decrease transparency of my atmosphere it looks like "thin" atmosphere.
    I will post some example screenshot's later...
     
  8. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Oh yeah!

    I make it, with some code snippet. :)

    Look at results from surface of proceduraly generated planet!


     
    Patico and boinst2 like this.
  9. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    Ooh what might I have done wrong here? My Jovian looks fine in the compiled version, but is magenta when running in the editor.
     

    Attached Files:

    • cap.png
      cap.png
      File size:
      279.5 KB
      Views:
      796
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Looks nice, I also remembered that you can just increase the 'Middle Power' field in the SgtAtmosphere component to change the alpha of the sky when the camera is inside the atmosphere, so you don't need to fiddle with it in the color gradient.


    Do you see any errors in the console? What is the exact version of Unity you're using? What platform are you running the editor on, and what platform are you trying to build for?
     
  11. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    I'm running Unity 5.2.2f1, I'm about to install 5.2.3f1.
    I'm running the editor on Windows 8.1 x64.
    My build target is Windows.

    However, I'm on a different computer today, and it's working fine here, maybe I just need to revert local changes on the other computer. So please ignore me for now, I'll come back if I can't figure out what I've done wrong on the other computer.
     
  12. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Thank you, darkcoder. I'am glad to read you :)
     
    Darkcoder likes this.
  13. gpaw5765

    gpaw5765

    Joined:
    Nov 27, 2015
    Posts:
    3
    Hello,
    I have a few questions about this toolkit:
    - In the asset store it says this extension requires one license per seat, what does it mean exactly? Does it mean the license cannot be used in more than one computer, or by more than one person, or at two computers at the same time? I'm developing on my own so it would be fine for me if the license is tied to my Unity account, but I'm planning to buy a new computer soon and I want to make sure I won't be forced to buy a new license for it.
    - How well does it perform on mobile platforms? Could you name a few mobile phones you have tested and some orientative data on performance? Is there a way to know which mobile phones are compatible and which aren't?
    - Won't you make a discount for Black Friday? :)

    Regards
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Unity wrote the license, so you should ask them. I'd rather not guess and make any mistakes!


    It depends which features you use and how much of them you use. I think it's fairly well optimized though, and you can easily scale down most of the effects to run faster. I don't have a list, but there are many apps out there that use SGT that you can try, for example THIS.


    Nope, I have no plans to change the price or enter into any discounts for the foreseeable future.
     
  15. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    It's per human. You can freely move between computers.
     
  16. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    On the displaced terrain, how do you make the right shaped textures from a texture map? Also, I love this pack. It is the majority of what's used object-wise in the game I'm developing.

    [EDIT]

    I figured it out
     
    Last edited: Nov 30, 2015
    Darkcoder likes this.
  17. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    This scene is based on the example "procedural star system" I put my planets into a separate layer so that they would render behind the players ship, but now the textures are not showing. Oddly, the Jovian is working fine :) Any suggestion what I might have missed? Any ideas much appreciated!

    1.jpg
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    What do you mean by separate layer? You created two cameras and clear the depth buffer between the background and foreground rendering?
     
    boinst2 likes this.
  19. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Then it should work, did you put an SgtObserver component on your background camera? Do both cameras use a perspective projection? Maybe send me a scene file I can test if it still doesn't work.
     
  21. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    Ah! No! I didn't! I'll bet that's it!

    Yes.

    Thanks I will if it doesn't turn out to be the SgtObserver.

    Thanks so much!
     
  22. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72
    Good afternoon. I've got rendering problems. The planets in my project have scales that range from 800 to 400 units that cause 2 problems:
    ss001.jpg

    1 - Stars are show through the solid planets like Mercury and Mars.
    2 - Planets with atmosphere and cloudsphere like Venus show graphical glitches from afar.

    Those problems got resolved if I put my camera near clipping plane to some high value like 200, stars don't get rendered when I do that.

    Should I try editing star shaders?

    Regards
    Thiago
     
    Patico likes this.
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    1 looks like a draw order issue. You likely have the 'Radius' setting on your SgtStarfield components set too low, so they're being rendered in front of your planets. If you increase this size (or just scale up the starfields), it should work.

    2 looks like a z buffer precision issue. You should try using a higher 'Height' setting on your SgtCloudsphere component. Alternatively, you can try editing the SgtCloudsphere.shader by adding an 'Offset' value, such as Offset -1, -1 or similar after line 37.
     
  24. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    Awesome! I've been wanting something like Kerbal Space Program. I also have a question. Are the displaced terrains supposed to look...bad... when far away. Screen Shot 2015-12-02 at 7.09.57 PM.png
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    It's hard to tell what's going on there, maybe post a picture of the planet close up in the scene view? You can always adjust the LOD level distances if the detail gets too low too soon.
     
    Cliftonm likes this.
  26. Galahad

    Galahad

    Joined:
    Feb 13, 2012
    Posts:
    72

    Good afternoon.

    1 - Had to set my 'Radius' to 50000 and set Star Radius Min and Max accordingly. But it worked!

    2 - Adding the 'Offset' value of -1, -1 at line 32 just before the Pass, diminished the problem but not fixed entirely. But it will suffice for now.

    Many thanks
    Thiago
     
  27. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    I updated the pack and keep getting the following error:
    Assets/Space Graphics Toolkit/Scripts/Player/SgtDisplacedTerrain.cs(14,31): error CS0115: `SgtDisplacedTerrain.GetSurfaceHeightLocal(UnityEngine.Vector3)' is marked as an override but no suitable method found to override

    I updated Unity and still have the error. I'm using 5.2.3. Also about the other thing, I think what you said is probably the issue.
     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Oh right, you need to delete SgtDisplacedTerrain.cs (or delete and reimport the whole SGT asset). I was supposed to make it empty as it's no longer used, but I guess I forgot.
     
  29. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    Thank you! I will try right now.
     
  30. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    Unity now just constantly crashes. It won't build.
     
  31. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    Never mind, it was an error with the new Unity update and support for VR.
     
    boinst2 likes this.
  32. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    I was able to reproduce the issue in the sample scene.

    I made a one-line change to SgtProceduralSystem (attached). I added this code "gameObject.layer = parent.gameObject.layer;", without which the new game objects would not be on the background layer.

    I've attached the project file, which includes the changes to have two cameras. I've also zipped the "Project Settings" so that you get the additional "Background" layer added to the project.

    Thanks in advance for any advice!
     

    Attached Files:

  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I sent you a fix, check your messages.
     
  34. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    Thanks so much for this fix! I've been itching to try it out, but I haven't had a chance yet. I will do so as soon as I can and report back.
     
  35. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    Everything works! Just one file (SgtLight.cginc) has errors, I had many variations of this error message, and I had magenta planets.

    Shader error in 'Hidden/SgtAtmosphereOuter': failed to open source file: 'SgtLight.cginc' at line 42 (on d3d11)
    Compiling Vertex program with DUMMY SGT_D

    That was easily fixed by removing leading "tab" characters on lines 6 and 10 of (SgtLight.cginc), and everything looks great! Thanks again for your support, everything is perfect.
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Not sure why that would cause issues, as it's been like that for a very long time, and I'm pretty sure other shader files have similar tabs.
     
  37. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    Hmm. Maybe it's nothing. Maybe I just had to "touch" the file to force Unity to "rebuild" it or something? Probably nothing worth worrying about.
     
  38. boinst2

    boinst2

    Joined:
    Apr 12, 2014
    Posts:
    13
    I see this warning a bunch of places on SGT planets. Is it anything to worry about?
    warning.png
    "This renderer has more materials than the Mesh has submeshes"
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    That's how the atmosphere rendering works.
     
  40. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    I'm building real-time large scale planetary rendering system. Size of the planet is about 600,000 units. Scattering, fog works well. But The Sun isn't in the sky. So, I tested atmosphere with different planet's sizes. And I realised, that the Sun is about 10.000 units from the planet center. For planets with less size everything ok, but larger than 10,000 there is no sun. May be somewhere in the code is 10000 value, and It can be changed! I can't change sun distance from script, there is no option. I've tried all options variations I found.
    Please, help me!!!
    First picture - planet from the sky. Second - planet from the ground - no sun where it should be. Third - planet with 10k size with sun last limited. With planet of 600k radius sun disappeared and found UNDER the planet surface...
     

    Attached Files:

    Patico likes this.
  41. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    OK, I fixed this by myself, at file SgtHelper, in function CalculateLite replace string case LightType.Directional: position = center + direction * 10000.0f; break;
    to string case LightType.Directional: position = center + direction * (position - center).magnitude; break;
    and Sun will Rise!!))
     
    Last edited: Dec 15, 2015
  42. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
  43. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Hey, LightenFor, nice ground shaders! Wich method do you use? Vertex colors?
     
  44. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    Actually, this is spherical triplanar + distance blend shader. It show accurate texture from large and short distance from surface. And yes, it use vertex color for texture blending. But I have problems with normal maps...
    trpl1.jpg
     
    Patico likes this.
  45. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    So i have problems with normal mapping too.
    Can we cooperate to find out the solution?
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Interesting, I guess I should know better yet than to add in arbitrary limits that I don't think users will reach :)

    I'll fix this in the next version.
     
  47. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    Yep!
    There is no limits in Space!!! You have good code, so I found needed place fast. Most of space game developers are suffer because of one thing - float limit errors rendering. So, It can be fixed with rendering planets to texture and showing it as a billboard or in skybox. If you handle It and add to your marvelous kit, It will be really cool ;)
     
    Cliftonm likes this.
  48. LightenFor

    LightenFor

    Joined:
    Dec 26, 2013
    Posts:
    26
    skype: masterofself
     
  49. LazyMan

    LazyMan

    Joined:
    Dec 7, 2013
    Posts:
    26
    Just do it!
     
  50. Cliftonm

    Cliftonm

    Joined:
    Nov 15, 2015
    Posts:
    36
    Have you considered making a procedural texture/height generator for the displaced terrain? Also, it there a way I could add water to my planets? Also, is there any way to do ground scatter?
     
    Last edited: Dec 16, 2015