Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    It's a Photoshop filter called LunarCell; I think it's pretty old. The planet doesn't exactly look AAA quality when running full screen (everything looks better when shunk down!), though considering it's procedurally generated and didn't cost me anything, I'm not complaining. :) If you're referring to the bumpiness in the shadow area, that's from the normal map generated by LunarCell. The SGT planet shader is a nice match for the textures that LunarCell produces.
     
  2. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Ah...figured it was that...but wasn't sure ...I have the LunarCell demo ...but export all keeps locking up my poor laptop..(using AMD quad-core APU laptop to make my game)..

    I am using it with Corel Paint Shop Pro Photo XI though... actually wish it worked with paint.net ...since it runs better and can handle larger sized pics since its 64bit..
     
  3. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Thanks...but what is line 119 for you? For me:

    118 o = surfaceColour;
    119 }

    I tried commenting out line 118, but that throws console errors.
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    Line 119 for me is:

    Code (csharp):
    1. surfaceColour.w = pow(e, falloff);
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    I guess I have a slightly older version of SGT, and would rather not upgrade right now, but there's no such line in my version. The only other SurfaceColour lines in my version of this script are:

    float4 surfaceColour;
    surfaceColour.xyz = lerp(night, day, lighting);
    surfaceColour.w = 0.0f;

    and

    surfaceColour.xyz *= tex2D(shadowTexture, shadowUV).xyz;

    Would commenting out either of these work?
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    Are you sure there's no other line modifying the surfaceColour.w? I'm not sure which version of SGT you're using, so it might be better to just post the whole fragment shader function (i.e. everything inside void Frag(...) { ...this stuff... })
     
  7. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Here's what I've got:

    void Frag(V2F i, out half4 o : COLOR)
    {
    float2 surfaceUV = SphericalUV(i.texcoord.xyz);
    float2 lightingUV = i.color.xy;
    #ifdef VARIANT_SHADOW
    float3 shadowM = i.texcoord1.xyz;
    #endif

    float3 day = tex2D(dayTexture, surfaceUV).xyz;
    float3 night = tex2D(nightTexture, surfaceUV).xyz;
    float3 lighting = tex2D(lightingTexture, lightingUV).xyz;

    float4 surfaceColour;
    surfaceColour.xyz = lerp(night, day, lighting);
    surfaceColour.w = 0.0f;

    #ifdef VARIANT_SHADOW
    float2 shadowUV = (length(shadowM.xy) - shadowValues.x) * shadowValues.y;
    #ifdef VARIANT_PLANETSHADOW
    shadowUV += shadowM.z;
    #endif
    surfaceColour.xyz *= tex2D(shadowTexture, shadowUV).xyz;
    #endif

    o = surfaceColour;
    }
     
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    It should work then, as it looks like you removed the part that sets the alpha.
     
  9. bajeo88

    bajeo88

    Joined:
    Jul 4, 2012
    Posts:
    64
    Hi,

    Recently bought your pack and looks amazing but i am running into very basic issues with the system. Im hoping there is a very simple step i am missing so ill keep playing around and see if i can get it but heres the problem at the moment.

    I am making a Sun and the creation works fine however when i view them at runtime during camera transitions/movement the newly created sun will move to another location (along the Y axis) as they are about to become viewed. I already have my game 90%+ complete and was hoping to simply update the graphics by replacing the prefabs i have. Im not manually moving the planet via code as i have simply positioned this newly created sun where my old sun was in the scene. Any ideas why this would be moving?

    Any suggestions would be of great help!

    Thankyou

    EDIT:

    Issue solved... some weird stuff going on with GIT hub and our code caused it to happen. Nothing to do with your asset so very happy here!
     
    Last edited: Aug 30, 2013
  10. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    I still got some questions left unanswered that hinder me to make a purchase:

    - I need some variety in how planet surfaces look like. Not much, but some. Both in visible surface shapes/textures and in color schemes. How would I create my own textures for your planets?

    - The nebulas/clouds/dust look nice, but can I make them look more vivid? Can I tween their transparency? Their rotation? Their scale? Make them "pulsate"?

    - I see I can generate a star field on the surface of a half-sphere/sky-dome (one of the screenshots). Can I turn that half-sphere around so that the stars are generated "below the players feet" so to speak (as required in my game, which has a top-down camera)?

    - Can I use your thrusters on my models? Just put a Transform where the engines would be on my models, throw your script on it, do some settings, and done?
     
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    You can make planet textures by hand using a camera + photoshop, then warping them into the required projections using a tool such as THIS. Or you can use a fully procedural software such as Lunar Cell, or some other planet generator capable of saving surface textures of what it generates. There are also many online sources that have real fictional planet surface textures that you can probably use in your own projects.



    You can adjust their transparency, texture, size, amount, spawn range, and fade distances. However, their rotations are set upon generation, so you can't individually alter their rotations. They also don't pulsate, mainly because I didn't anticipate anyone wanting pulsating nebula particles. But if you know the basics of shader programming then this is something that's fairly easy to implement.



    Yes, you can rotate the starfields however you like.



    Yep, that's exactly how they work.
     
  12. Deleted User

    Deleted User

    Guest

    Another question,has anyone tested it on windows phone 8? I have a device with windows phone,but the version is 7.8 xD
     
  13. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,238
    Yes, it works now (no glow on Jupiter). Thanks much!
     
  14. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    I'm having a problem with the way the planets render when they are scaled to a size of around 24,000 or more. I also have a problem when i am far away from the planets. They turn white. When the planets are very large, and im talking about the example earth planet here, it only works if the camera is close to it or if the atmosphere is disabled. I have a game where i can fly around in space. When I fly further away from the planet the planet becomes engulfed with white atmosphere and I can no longer see anything but a white sphere, only as I approach incredibly close to the surface do I see the planet rendered correctly, with its clouds and surface layers. What's going on? I've tried changing the render queue, I've tried changing the LUT. This only happens when I run it on my android. What can I do?
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    The issue is most likely caused by depth buffer imprecision, or incorrect camera near far clipping plane distances. In your Android PlayerSettings window, try enabling 'Use 24-bit Depth Buffer'. If this doesn't solve the problem then try tweaking the near far clipping plane distances of the camera used to render your planet, ideally these distances should be large enough to cover your whole scene, but not too large to cause depth buffer issues. Try playing around with these two settings, as they're the only thing that can really cause planets to turn white as you describe.

    Scaling a planet to 24,000 units shouldn't be an issue, but I believe most of the demo scenes have the camera clipping planes adjusted to suit that specific scene, so changing the planet size may cause the planet to clip into the clipping planes if you don't also modify the camera.
     
  16. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    ok my current scene has a clipping near of 0.1 and a far of 1,000,000. Now I've imported a prefab of the solar system example into my game scene. At the moment I still get this clipping on earth (unless I'm very close to it) along with the sun and a few other planets. In order to be more precise I could film it from my android but I'd need to record the screen. I cant really make it smaller cause then planets way out in the distance disappear. It's strange. When I get a chance I'll take pictures of it.
     
  17. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    Yea a range of 0.1 to 1,000,000 is way too high, you should probably aim for 100,000 or less for the far plane if you need 0.1 for the near. Of course, this means your planets will go outside of the far clipping plane, but you can get around this by shrinking and moving your planets toward the camera if they're far away. To do this, you need to use a script like this:

    ScaleByDistance.cs
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. public class ScaleByDistance : MonoBehaviour
    4. {
    5.     public Camera  mainCamera;
    6.     public Vector3 position;
    7.     public float   radius;
    8.     public float   distanceMin         = 1000.0f;
    9.     public float   distancePow         = 10.0f;
    10.     public bool    readPositionOnAwake = true;
    11.     public bool    readRadiusOnAwake   = true;
    12.    
    13.     protected virtual void Awake()
    14.     {
    15.         if (readPositionOnAwake == true)
    16.         {
    17.             position = transform.position;
    18.         }
    19.        
    20.         if (readRadiusOnAwake == true)
    21.         {
    22.             var star     = GetComponent<SGT_Star>();
    23.             var planet   = GetComponent<SGT_Planet>();
    24.             var gasGiant = GetComponent<SGT_GasGiant>();
    25.            
    26.             if (star     != null) radius = star.SurfaceRadius;
    27.             if (planet   != null) radius = planet.SurfaceRadius;
    28.             if (gasGiant != null) radius = gasGiant.AtmosphereRadius;
    29.         }
    30.     }
    31.    
    32.     protected virtual void Update()
    33.     {
    34.         UpdateScale();
    35.     }
    36.    
    37.     protected virtual void LateUpdate()
    38.     {
    39.         UpdateScale();
    40.     }
    41.    
    42.     private void UpdateScale()
    43.     {
    44.         if (mainCamera == null) mainCamera = Camera.main;
    45.        
    46.         if (mainCamera != null)
    47.         {
    48.             // Default scale and position
    49.             var newPosition   = position;
    50.             var newLocalScale = 1.0f;
    51.            
    52.             // Find distance to camera
    53.             var vector   = position - mainCamera.transform.position;
    54.             var distance = vector.magnitude - radius;
    55.            
    56.             // Does it need to be scaled?
    57.             if (distance > distanceMin)
    58.             {
    59.                 var scale = 1.0f - Mathf.Pow(1.0f - distanceMin / distance, distancePow);
    60.                
    61.                 newPosition   = mainCamera.transform.position + vector * scale;
    62.                 newLocalScale = scale;
    63.             }
    64.            
    65.             var localScale3 = new Vector3(newLocalScale, newLocalScale, newLocalScale);
    66.            
    67.             // Write changes
    68.             if (transform.position   != newPosition) transform.position   = newPosition;
    69.             if (transform.localScale != localScale3) transform.localScale = localScale3;
    70.         }
    71.     }
    72. }
    Attach this to your planets, stars, etc and it should pretty much limit how far away anything can be from the camera. You may have to play around with the distanceMin and distancePow settings depending on your scene. distanceMin = minimum distance required before the scaling occurs. distancePow = the scaling factor, if your camera draw range is large then you can use a higher value here.
     
  18. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Thanks for that, I can use that too. I've been playing with using a "background" camera technique, which doesn't quite play well with some other assets, so this could be a nicer solution.
     
  19. QFGlenn

    QFGlenn

    Joined:
    Feb 21, 2013
    Posts:
    39
    I'm having a lot of trouble with the render queue values and compiling the game for android. I haven't changed this value, just let the default setting remain the value and when I play the game it is all messed up. What causes this?
     
  20. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    well im going to try shrinking all objects in my game down to about a 30'th of what they are now and set the clipping from say near of 1 to far of 50,000 and check the APK to see if it is fixed. Thanks for the help, i have a good feeling this might fix it. Also having smaller objects in the game might make it easier to work with anyway.
     
  21. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    well that didnt make any difference. Still have about the same results. I've got to be very close to the sample earth planet to have it render correctly on the phone when the atmosphere render queue is higher than the surface render queue. So for now the only thing that seems to work is setting the surface render queue higher than the atmosphere queue which works but it tends to kill the clouds so I have to use clouds that are painted onto the surface of the planet. I'm kinda glad shrinking scale wasn't a fix because i would have had to recode a lot of velocities and it took me hours just to resize a few things so i could test it with my spacecraft/camera. Anyway yeah so I dunno it's frustrating to have to set the surface queue so that it renders before atmosphere but it's not a game breaker. Clouds painted on to the surface wont kill me. Maybe i'll make transparent cloud texture sphere and make it slightly larger than the planet and then rotate it opposite the planets rotation that might give me the same effect.
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    Did you try the script I posted? And did you try changing the depth buffer to 24bit? Simply scaling your whole scene down by a single value won't really change much.


    Which components are being messed up? and what do you mean by messed up? are the render queue values changing on their own?
     
    Last edited: Sep 3, 2013
  23. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Sorry ...another question for you (hope your still watching this thread)...


    This LunarCell creates a procedural texture for the terrain? or a series of textures for the terrain?

    Sorry ...im asking because the plug-in demo seems to not be working well with my Paint Shop Pro Photo XI ...even though they claim on the site that it should work for both PSP and PhotoShop..

    So im thinking its because my laptop isn't powerful enough ...so moving PSP to my desktop (8-core with 16gigs of ram) ..then will try this again..

    Figured I would ask though in case I run into more issues ...might have to break down and get PhotoShop..
     
  24. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    There are a bunch of different textures it can export, and several of them are directly applicable to the SGT planet shader. There's the base diffuse (color) map, an ocean map that can be used to create a simple specular map (I believe I had to invert those), a "city lights" map, and a bump map. One of the bump map choices keep the oceans flat. I experimented a bit with different tools to convert the bump map to a normal map, but the built-in Unity conversion actually worked the best as it turned out.

    There is also an option to export cloud maps, but I didn't have good luck with that. Which is really too bad, because LunarCell has a crazy-cool option for pulling in real-time Earth satellite data. It looks great in the plug-in, but what it exports is an unusable mess. I don't know if that's a bug or what. If you export procedurally-generated clouds, the export works right, but I didn't think those looked very good. So I'll end up getting cloud textures from other sources.

    It's really too bad it's not a stand-alone product, as it doesn't interact with Photoshop in any meaningful way that I can see, other than just dumping the textures into it.

    Here are some of the ones I've come up with. These are all rendered with the SGT planet shader (I'll use unique cloud textures in the real game):
    http://www.stevetack.com/misc/planets.png
     
    Last edited: Sep 5, 2013
  25. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Yeah... I think the demo version is restricted ...or its not working in PaintShop ...since it just sits there "rendering" for hours at 0% ..no visible CPU usage on all 8-cores...

    Your planets look pretty good ....I assume the terrain looks good up close ...or you haven't tried yet?
     
  26. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Depends on what you mean by "good" and by "up close." Being close enough so that the planet is overlapping the edges of the screen, they start looking a little shaky. Overall, I'd say that if I release my game as a free game (not free-to-play, just free), that quality level would be acceptable, given that I'm not going to allow the player to get all that close to planets. If I get to the point where the game is pretty fun and complete, I'd consider commissioning some real art and try charging a few dollars for the game. Hand created textures would be the way to go if you've got, you know, a budget. :D

    If by "up close" you mean you want to fly to the planet's surface, that's not going to look great, IMO. I actually tried flying in really close last night, and it didn't look *that* terrible I suppose. It helps that the shader starts whiting stuff out when you're super close. I'm currently using 2048 x 1024 for each texture, so you can't get super close without things getting blurry. I may play around with 4096 x 2048, but given that some planets have diffuse, specular, normal, city lights, *and* cloud textures, that starts to get pretty heavy duty.

    I'm not 100% sure what you mean by "terrain." There are different colors in the diffuse map to represent land mass and some bump mapping, but that's it. I don't have any 3D geometry or anything going on, aside from smooth spheres.
     
  27. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Well I am considering making my own ...using a copy/paste/blend method using sat images and try to get some "beach" ..."dirt" ..."grass" .."rock" or whatever going ... or just use plain textures ...I found the method on here: http://www.foundation3d.com/forums/showthread.php?t=10916 on the PDF ..it seems fairly simple.

    Well I assumed you were going to use the tessellation ... since I assume it will make your planets look better with terrain... I haven't been playing with it much ..been busy with other parts of my game project..

    Also I exported ONLY the terrain from lunarcell ...colormap ...and I ran it through shadermap2 in order to make normal,spec,AO, and displacement maps for the terrain ...to see how that looks too..
     
    Last edited: Sep 5, 2013
  28. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    No, I won't let the player get so close that terrain would be visible anyway. Even shots from the space shuttle or whatever where they aren't even all that high up you can't make out elevation changes.

    I'm just using planets more or less as background images to help give certain locations an identity. I even considered baking them into my skyboxes, but that's not too flexible obviously. I also played around with rendering images and billboarding them, but that has its own issues. Ultimately the 3D planets felt more like planets and are a lot more flexible. Like certain areas I can simulate being much farther away or on the other side by having them at various scales and positions. The thought process on my game is that you're either on thrusters and fairly limited in where you can go in a reasonable amount of time, or you're jumping to a new location instantly. It's fun to travel for minutes at a time in GTA, but I'm not sure how fun that'd be in a spaceship. :)
     
  29. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212

    I decided to use L3DT Indie Pro for the planet terrain http://www.bundysoft.com/docs/doku.php?id=l3dt:about:tour ...I made a 16384x8192 terrain map that was 5meters per pixel ...then exported it to 4096x2048 1meter per pixel ..ran it through the skysphere generator that was posted earlier in this thread http://forum.thegamecreators.com/?m=forum_view&t=184236&b=5 ...then I made Displacement,normal and specular maps from the terrain using ShaderMap2 ...had to invert the specular map as required..so water was white/whitish ..

    I added an actual grass detail texture instead of greyscale to give it a little more green.. for the surface tessellation..


    The only annoying part now is I don't have water... and it seems adding it to the planet is harder than I thought with the water system I picked ..Fluvio 2 Pro..

    Video of the planet http://www.youtube.com/watch?v=eyhhJejd1ok

    Also a side note ....I just got another update for this asset ...but it doesn't appear to have anything new ..so now im confused a bit...lol
     
    Last edited: Sep 9, 2013
  30. Azmodii

    Azmodii

    Joined:
    May 7, 2013
    Posts:
    4
    Hi,

    Firstly thanks for an awesome toolkit! This will certainly help cut some time off prototyping my current project.

    I only really have one question, in a future update - Could you provide the scene for Misty Galaxy? I'm working on my own particle system generating a spiral galaxy and it would really help to have something to compare it with.

    Thanks again,

    Az.
     
  31. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Hi Darkcoder,

    Been using this plugin so far and it's looking pretty good.

    However, we are running into a little problem with using the SGT_Starfield component within a prefab where it renders just fine in the editor but not in the webplayer (as well as iOS device).

    If I create a GameObject and attach the component manually in the editor, it works just fine in the editor as well as in the webplayer.
    If I make this GameObject into a prefab by dragging it into the Project window in Unity, then create new instances from this prefab, the new instances do not render in the webplayer. Likewise when instantiating new instances from the prefab using script. Even calling Regenerate doesn't work (packer.OutputCount is 0, so it skips the regeneration code).

    If you PM me your email, I have a Unity scene I can zip up for you to download via private shared link on Dropbox (although the plugin itself is quite large at over 250MB).

    Thanks.

    Danien
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    If you mean SGT, then check the change log. I added a few things that maybe only Oculus users would notice, and I added a small feature to the nebulas that I forgot to initially.



    I don't think I even have the original media or scene files for the Misty Galaxy, as I tried looking for them a little while back. I guess I must have wiped that particular project with a new version of SGT without saving that data, oops.

    In any case, you can probably just decompile the demo scene to see what's going on... assuming that's legal.



    Thanks, I can indeed reproduce this bug. I'll take a look at it tomorrow, as I imagine it will be slightly annoying to track down.
     
    Last edited: Sep 10, 2013
  33. rumorgames

    rumorgames

    Joined:
    Nov 28, 2012
    Posts:
    35
    Hi there,

    I'm trying to get my game running on Windows Phone 8, and although most features work without issue, there is some serious weirdness with planet rings:

    $wp_ss_20130910_0001.png

    It looked like a shadow issue, but I turned off surface shadows and it's clear the ring isn't drawing properly, either:

    $wp_ss_20130910_0004.png

    Any ideas about what could be causing this, or suggestions for fixes or workarounds?

    Thanks!
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    I don't have access to a Windows phone yet, but can you explain what's going on in the second screenshot? Is the ring not rendering at all? What if you change all of the settings? Does the log contain any shader errors or similar?
     
  35. Azmodii

    Azmodii

    Joined:
    May 7, 2013
    Posts:
    4
    Thanks DarkCoder,

    I think it might be easier to just replicate it myself haha!
     
  36. rumorgames

    rumorgames

    Joined:
    Nov 28, 2012
    Posts:
    35
    Correct, the ring isn't visible at all (though if I move the camera around, sometimes a tiny bit of aliasing is visible when it's edge-on). No obvious error messages, though that may be because the debug output when running on a Windows Phone device isn't very verbose. I've tried different slice configurations, and I just tried disabling all ring lighting, scattering, and shadows, with the same result.
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    I believe I found the cause of this issue, let me know if this fixes it:

    SGT_PackerInput.cs
    Code (csharp):
    1. using UnityEngine;
    2.  
    3. [System.Serializable]
    4. public class SGT_PackerInput
    5. {
    6.     [SerializeField]
    7.     private bool modified;
    8.    
    9.     [SerializeField]
    10.     private Texture2D texture;
    11.    
    12.     [SerializeField]
    13.     private string name;
    14.    
    15.     [SerializeField]
    16.     private int index;
    17.    
    18.     [SerializeField]
    19.     private SGT_PackerTrim trim;
    20.    
    21.     [SerializeField]
    22.     private Color trimColour;
    23.    
    24.     [SerializeField]
    25.     private SGT_PackerBorder border;
    26.    
    27.     [SerializeField]
    28.     private SGT_PackerBorderSize borderSize;
    29.    
    30.     [SerializeField]
    31.     private bool tilesheet;
    32.    
    33.     [SerializeField]
    34.     private int tilesheetTilesX = 1;
    35.    
    36.     [SerializeField]
    37.     private int tilesheetTilesY = 1;
    38.    
    39.     [SerializeField]
    40.     private object data;
    41.    
    42.     public bool Modified
    43.     {
    44.         set
    45.         {
    46.             modified = value;
    47.         }
    48.        
    49.         get
    50.         {
    51.             return modified;
    52.         }
    53.     }
    54.    
    55.     public Texture2D Texture
    56.     {
    57.         set
    58.         {
    59.             if (value != texture)
    60.             {
    61.                 texture  = value;
    62.                 modified = true;
    63.             }
    64.         }
    65.        
    66.         get
    67.         {
    68.             return texture;
    69.         }
    70.     }
    71.    
    72.     public string Name
    73.     {
    74.         set
    75.         {
    76.             if (value != name)
    77.             {
    78.                 name     = value;
    79.                 modified = true;
    80.             }
    81.         }
    82.        
    83.         get
    84.         {
    85.             return name;
    86.         }
    87.     }
    88.    
    89.     public SGT_PackerTrim Trim
    90.     {
    91.         set
    92.         {
    93.             if (value != trim)
    94.             {
    95.                 trim     = value;
    96.                 modified = true;
    97.             }
    98.         }
    99.        
    100.         get
    101.         {
    102.             return trim;
    103.         }
    104.     }
    105.    
    106.     public Color TrimColour
    107.     {
    108.         set
    109.         {
    110.             if (value != trimColour)
    111.             {
    112.                 trimColour = value;
    113.                
    114.                 if (trim == SGT_PackerTrim.Colour)
    115.                 {
    116.                     modified = true;
    117.                 }
    118.             }
    119.         }
    120.        
    121.         get
    122.         {
    123.             return trimColour;
    124.         }
    125.     }
    126.    
    127.     public SGT_PackerBorder Border
    128.     {
    129.         set
    130.         {
    131.             if (value != border)
    132.             {
    133.                 border   = value;
    134.                 modified = true;
    135.             }
    136.         }
    137.        
    138.         get
    139.         {
    140.             return border;
    141.         }
    142.     }
    143.    
    144.     public SGT_PackerBorderSize BorderSize
    145.     {
    146.         set
    147.         {
    148.             if (value != borderSize)
    149.             {
    150.                 borderSize = value;
    151.                 modified   = true;
    152.             }
    153.         }
    154.        
    155.         get
    156.         {
    157.             return borderSize;
    158.         }
    159.     }
    160.    
    161.     public int Index
    162.     {
    163.         set
    164.         {
    165.             if (value != index)
    166.             {
    167.                 index    = value;
    168.                 modified = true;
    169.             }
    170.         }
    171.        
    172.         get
    173.         {
    174.             return index;
    175.         }
    176.     }
    177.    
    178.     public bool Tilesheet
    179.     {
    180.         set
    181.         {
    182.             if (value != tilesheet)
    183.             {
    184.                 tilesheet = value;
    185.                 modified  = true;
    186.             }
    187.         }
    188.        
    189.         get
    190.         {
    191.             return tilesheet;
    192.         }
    193.     }
    194.    
    195.     public int TilesheetTilesX
    196.     {
    197.         set
    198.         {
    199.             value = Mathf.Max(1, value);
    200.            
    201.             if (value != tilesheetTilesX)
    202.             {
    203.                 tilesheetTilesX = value;
    204.                 modified        = true;
    205.             }
    206.         }
    207.        
    208.         get
    209.         {
    210.             return tilesheetTilesX;
    211.         }
    212.     }
    213.    
    214.     public int TilesheetTilesY
    215.     {
    216.         set
    217.         {
    218.             value = Mathf.Max(1, value);
    219.            
    220.             if (value != tilesheetTilesY)
    221.             {
    222.                 tilesheetTilesY = value;
    223.                 modified        = true;
    224.             }
    225.         }
    226.        
    227.         get
    228.         {
    229.             return tilesheetTilesY;
    230.         }
    231.     }
    232.    
    233.     public object Data
    234.     {
    235.         set
    236.         {
    237.             if (value != data)
    238.             {
    239.                 data     = value;
    240.                 modified = true;
    241.             }
    242.         }
    243.        
    244.         get
    245.         {
    246.             return data;
    247.         }
    248.     }
    249. }
    Keep in mind that this change will require you to set the starfield textures again.



    I have no idea, but if you can still see something when it's edge on then maybe it's some kind of texturing issue. What happens when you set the texture to something that doesn't contain alpha, e.g. the Earth surface texture.
     
  38. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212

    I could not get this to work right with 2 character controller types .. 1 was a character controller from Ultimate FPS ...it would walk and jump ....but it kept getting stuck in the ground and the character kept responding as if being shot at or hit and it would lose health and die ...and it kept flipping over on its head... the second controller was a custom one without any health and such...that one wouldn't even stay on the surface ...it would slide off the planet and fall into space..

    I have a thought on this ...and im thinking the surface of the planet has to be almost perfectly smooth...mine is NOT http://www.pasteall.org/pic/show.php?id=59130

    The OTHER thought I have is its due to the "water sphere" I placed under the planet to get water to work ...almost how I wanted..

    If you could help out on how to get a character to work correctly on the surface that would be great ..thanks..
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    I don't know how these character controllers are implemented, so I'm not exactly sure what must be done to get them to work properly. If your character is sliding off the planet then I'm guessing your gravity vector isn't set to move toward the centre of the planet. Fixing this entirely depends on how the CC works, can you not specify which direction is 'up' using Ultimate FPS? Also, make sure you disable Unity's built-in gravity for this, and use SGT's Gravity Source and Gravity Reciever components if these CCs don't implement their own.
     
  40. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Yup, appears to be fixed. Thanks for the quick response!
     
  41. PDZ

    PDZ

    Joined:
    Sep 12, 2013
    Posts:
    18
    Any idea why I can't build any of the example scenes on iOS device? When launching the app I get:

    SGT_Corona[] doesn't implement interface System.Collections.Generic.IEnumerable<SGT_MonoBehaviourUnique<T>>
    * Assertion: should not be reached at mini-trampolines.c:183

    $Screen Shot 2013-09-12 at 08.43.12.png


    A similar error occurs for all the Space Graphics Toolkit objects. I am using Unity 4.2.0f4

    Thanks
     
    Last edited: Sep 12, 2013
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    These errors are caused by the new version of SGT_MonoBehaviourUnique.cs, which was designed to fix an issue with Windows 8 mobiles. I'm currently working on a way to support both platforms, but for now you can just use the old version, which you can get from HERE.
     
  43. PDZ

    PDZ

    Joined:
    Sep 12, 2013
    Posts:
    18
    Thanks, that works! Thanks for the speedy reply
     
  44. Deleted User

    Deleted User

    Guest

    Hi guys,how can I make a background, for example such as here. What i need to use : skybox or skysphere?And what should be the size of the background texture?

    Thanks.
     
  45. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    How can I change the render queue during gameplay? I'd like to increase the render queue of planets that are closer and reduce the queue of planets that are further away. Right now I've got this solar system demo but if the planets are lined up I end up having issues where some planets render before others and as a result I can see a planet through another planet. It's very annoying...
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    You can change the render queues of your planets via: yourPlanet.SurfaceRenderQueue and yourPlanet.AtmosphereRenderQueue

    Keep in mind that changing the render queue will only alter the draw order, the actual visible order of solid objects on screen is defined by the z depth. Thus, if planet A is being drawn on top of planet B, then planet A is closer to the camera. If you need planet B to draw on top of planet A, then you need to move planet B closer to your camera.
     
  47. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    I am not trying to be difficult ...but HOW do I make it so the planets are massive scale at ground level ...so that the surface is actually horizontal ...like actual terrain map?


    Like if I land on the planets surface I don't want to see the land curving in any direction while im walking around ...


    Because I tried making the planets massive scale until they nearly met the limits of Unity ..but the planet was still "curving" ...

    I will refer to KSP again(kerbal space program) ... the planets look massive scale ...and landing on the surface takes some time ... and the surface is actually quite flat(horizontal) ... and a previous user showed proof that they are using your SGT asset for the planets ... they are using Unity 4.1 engine...

    I already tried your "scale by distance" script but it doesn't appear to do anything at all ...planets are the same if I use it or not..
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    If your planets still appear very round then you either need to make them bigger, or move the camera closer to the surface. Keep in mind that making them bigger doesn't just mean giving your planets ridiculous radius values, it can also mean that you need to reduce the scale of your actual scene. For example, Earth has a surface radius of 6,371km, if your scene uses a scale of 1 unit = 1 metre, then your Earth will need a radius of 6,371,000 units, this is clearly ridiculous and needs to be scaled down.

    The Scale By Distance script is designed to reduce depth buffer precision artifacts by moving distant objects closer to the camera, so it wouldn't have any effect here.
     
    Last edited: Sep 16, 2013
  49. acriticalstrike

    acriticalstrike

    Joined:
    May 25, 2013
    Posts:
    75
    I know you're very helpful on these forums and I do need some help with this scripting. I am not sure how to write a script that will make planets that are near the camera higher up on the render queue than planets that are further away. I also need to do this with the atmospheres, asteroid rings, coronas, etc... I'm not sure how though. I think you mentioned something about it earlier but I'm not sure I understand. What I truly dont understand is how come I even need to change render queue at all, why should something that is in front of another render before it?


    So lets say I have a scene like the demo solar system. So i'm flying around in my spaceship and sometimes I see planets that are near my ship rendered behind planets that are very far away... It totally kills the illusion. Lets say the sun is in front of the planet Jupiter and Jupiter is way in the background and yet the suns corona is rendered after the planet... So it breaks the illusion. But this works well if I'm over by Jupiter if Jupiter is near the spaceship and the sun is way out in the distance behind Jupiter then the render queue is correct the corona should render after Jupiter.... My question is... why isn't this done automatically.. And since it's not ...

    How do i write this script it's gotta be easy... things near the camera get a render queue that is higher while things further away get a lower render queue this way no matter what everything is rendered correctly. This is a real issue for my space shooter. Can you give me an example of this script? :confused:

    thanks !
     
  50. rumorgames

    rumorgames

    Joined:
    Nov 28, 2012
    Posts:
    35
    Interesting. This is what happens when I use a ring texture with no alpha. Shadows were disabled, and it made no difference whether the various ring effects (lighting, scattering) were enabled. The effect is that the ring is transparent when nearly edge-on, but semi-opaque from other angles.

    $wp_ss_20130917_0001.jpg