Search Unity

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,414
    No, because the asteroid positions aren't stored on the CPU, they're instead calculated in the vertex shader. This was the only way to make it so you can have tens/hundreds of thousands of asteroids without much FPS hit.

    If you want to be able to mine/destroy/etc asteroids in orbit, then I suggest you place them individually and use a script such as Simple Orbit to make them orbit something. This placement could also easily be done using a script to place hundreds of them quite easily.
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    none of your demo scenes works on my mac, i got black screen, or few form in pink( missing materials?)
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Does your graphics card support shader model 2.0? That's the only issue I can think of that would cause this.
     
  4. clockworkTony

    clockworkTony

    Joined:
    Mar 26, 2014
    Posts:
    1
    Hi

    Firstly thanks very much for the package. Just got it and am enjoying it so far.

    I have a quick question about the Alien world scene. It looks great but I have noticed that the asteroids seem to blink when a certain distance away. Up close they are wonderful but at a distance they seem to blink. Is this the expected behaviour?

    thanks again

    Tony
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Is this when they get close to 1 pixel in size? If so, then it's to be expected, as they use alpha test (one bit alpha). If it's an issue then you can fairly easily modify the asteroid ring shader to hide asteroids that fall below a certain screen size, or set a minimum radius (line 71 of SGT/Required/Shaders/Resources/AsteroidRing/Include.cginc).
     
  6. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    yes its a 2012 MBP
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    I'm not sure. It works on my Mac Mini, and I haven't heard of other people experiencing this kind of issue. Do other shader-based unity WebPlayers give you these kinds of errors?
     
  8. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Because it could potentially solve the "Edge of the World problem" with flat terrains, by having a spherical terrain.
    Also current day night cycle solutions seem to be using smoke and mirrors to simulate sun and moon, so if I could have an actual moon orbiting an actual planet which in turn was orbiting a star, well it seems a better cleaner solution, and you'd get benefits like solar eclipses.
    Also I wanted to support Darkcoder who has been developing this asset for almost 2 years, and providing great support as you can see from this forum.

    So the aim is to create these celestial bodies stand on the planet and watch a sunrise etc.

    This kit is so good and well done I had the basic solar system running in about an hour and did a video below. Also I built the project stuck it on my base spec test machine which is an Athlon 64x2 dual core 4200 with 2gb ram and a $20 Radeon HD5400 graphics card.
    Started Fraps
    Started the game selected full screen and highest setting (Fantastic) 1600x900 and it ran at 60fps (I don't thing fraps goes above 60fps) so probably more fps.

    PS the game runs much smoother and better looking than the video shows.

    [video=youtube_share;0kBZMnkcgII]http://youtu.be/0kBZMnkcgII
     
  9. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    I have a question, well more can you point me in the right direction. I want to get a first person controller on the planet and running around ideally UFPS which is also a fantastic asset. I tried making the first person controller a child of the planet and giving it an orbit but it didn't like that and threw up errors

    Where would be a good place to start do you think?
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Nice video :)

    I don't know how UFPS works, so it might be easy/hard to do.

    If you look at the Spaceship On Surface demo scene then you can see how I attach a normal rigidbody to the surface of a planet. If doing the same thing and adding a Snap To Surface component to your character controller doesn't work then maybe there's a setting in the character controller to specify the up-vector. If so, then you'd just need to write a script to continually set the up-vector based on the snapped rotation. If not then you should ask the UFPS developer how to do it.
     
  11. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Thanks for the advise Darkcoder, I understand and I'm confident I could get it to work.
    But I've been thinking and I cant see how I could create a spherical nav mesh in Unity and if I did I'm not sure how the nav mesh agent would cope with it.
     
  12. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    I've never used the NavMesh feature of Unity so I'm not sure. I think I read somewhere that it's only really designed for standard y = up maps, but let me know if you get it working.
     
  13. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    If any of you guys want a character walking on the surface of your planets.. I just found some code that might help..if you guys didn't see it yet..

    Not sure how well it works with SGT planets..it appears to have jumping also(the code was updated on 7 March 2014)..

    Link to the wiki: http://wiki.unity3d.com/index.php/WalkOnSphere

    The code:
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class WalkOnSphere : MonoBehaviour
    5. {
    6.     #region vars
    7.     public float rotSpeed = 50;
    8.     public float moveSpeed;
    9.     public float rotDamp;
    10.     public float moveDamp;
    11.     public float height;
    12.     public float jumpHeight;
    13.     [Range(.1f, 10f)]
    14.     public float gravity;
    15.     public float radius;
    16.  
    17.     public Transform planet;
    18.     protected Transform trans;
    19.     protected Transform parent;
    20.  
    21.     protected float angle = 90f;
    22.     protected float curJumpHeight = 0;
    23.     protected float jumpTimer;
    24.     protected bool jumping;
    25.  
    26.  
    27.  
    28.     protected Vector3 direction;
    29.     protected Quaternion rotation = Quaternion.identity;
    30.  
    31.     #endregion
    32.  
    33.     #region Unity methods
    34.     void Start ()
    35.     {  
    36.         trans = transform;
    37.         parent = transform.parent;
    38.     }
    39.  
    40.     void Update ()
    41.     {
    42.  
    43.         //parent.position = planet.position; // If you want to have a moving planet
    44.  
    45.         direction = new Vector3(Mathf.Sin(angle), Mathf.Cos(angle));
    46.  
    47.         if(Input.GetKey(KeyCode.LeftShift))
    48.             Position(Input.GetAxis("Horizontal") * -moveSpeed, 0);
    49.         else
    50.             Rotation(Input.GetAxis("Horizontal") * -rotSpeed);
    51.  
    52.         if(Input.GetButtonDown("Jump")  !jumping)
    53.         {
    54.             jumping = true;
    55.             jumpTimer = Time.time;
    56.         }
    57.  
    58.         if(jumping)
    59.         {
    60.             curJumpHeight = Mathf.Sin((Time.time - jumpTimer) * gravity) * jumpHeight;
    61.             if(curJumpHeight <= -.01f)
    62.             {
    63.                 curJumpHeight = 0;
    64.                 jumping = false;
    65.             }
    66.         }
    67.  
    68.         Position (0, Input.GetAxis("Vertical") * moveSpeed);
    69.         Movement();
    70.     }
    71.     #endregion
    72.  
    73.     #region Actions
    74.     protected void Rotation(float amt)
    75.     {
    76.         angle += amt * Mathf.Deg2Rad * Time.fixedDeltaTime;
    77.     }
    78.  
    79.     protected void Position(float x, float y)
    80.     {
    81.         Vector2 perpendicular = new Vector2(-direction.y, direction.x);
    82.         Quaternion vRot = Quaternion.AngleAxis(y, perpendicular);
    83.         Quaternion hRot = Quaternion.AngleAxis(x, direction);
    84.         rotation *= hRot * vRot;
    85.     }
    86.  
    87.     protected void Movement()
    88.     {
    89.         trans.localPosition = Vector3.Lerp(trans.localPosition, rotation * Vector3.forward * GetHeight(), Time.fixedDeltaTime * moveDamp);
    90.         trans.rotation = Quaternion.Lerp(trans.rotation, rotation * Quaternion.LookRotation(direction, Vector3.forward), Time.fixedDeltaTime * rotDamp);
    91.     }
    92.  
    93.     protected float GetHeight()
    94.     {
    95.         Ray ray = new Ray(trans.position, planet.position - trans.position);
    96.         RaycastHit hit;
    97.  
    98.         if(Physics.Raycast(ray, out hit))
    99.             radius = Vector3.Distance(planet.position, hit.point) + height + curJumpHeight;
    100.  
    101.         return radius;
    102.     }
    103.  
    104.     #endregion
    105. }
     
  14. WarpB

    WarpB

    Joined:
    Nov 12, 2013
    Posts:
    14
    Hey Darkcoder! Bought your kit during the sale and really liking it so far!

    I'm developing an iphone game, but only have an iphone4 to test on... so far I've used the asteroid rings to great effect filling out the background of my own dynamic asteroid field, and the star field also seems to perform very well. Where I've run into trouble is with the infinite dust field and the nebulae, both of which cause dramatic drops in performance on the iphone4.

    I managed to get a passable dust cloud going by setting count to only 5, with scale at 1 and the alpha turned up a little to make up for the lower count... not to bad, but last night I attempted to fill out my background with a nebula; It looks beautiful, but frame rates drop to around 2 fps (i have it locked to 25 but it was going so slow I could actually count each frame update, hehe). Am I doing something wrong, or am I hoping for too much to get a nebula going on the iphone 4?

    One other thing I'll mention is with fog enabled, the dust clouds and nebulae turn a pretty bright pink at run-time. I've had to get around the issue by rendering them on a separate camera that has fog disabled. Could this be related to my low performance? I'll try a test now with fog entirely disabled to see what happens, but any insight and tips you could give me would be most appreciated!

    I know the iphone 4 is an older device, but in the FAQ's on the first page of this thread it claims to have been tested on a 3GS, so I'm hoping I might just be missing some essential settings!

    Thanks and regards, Warp.
     
  15. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    I'm on Iphone 4 and really would like to know the limits for this device with Space Graphics.
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    The issue here is fillrate, the iPhone 4 has a resolution of 640x980, which is 600k pixels. If your dust cloud or nebula is close to the camera then it might be rendering 5 or more full screen particle quads, which means it's rendering at least 3 million pixels per frame. The particle shaders themselves are fairly well optimized, so the only way to improve performance is to reduce the size of your dust particles, or to reduce the amount of them.

    I haven't tested the dust clouds with fog, but I'd guess the issue you're experiencing is due to the way the colours are being blended. The dust clouds use additive blending (i.e. the RGB values from your background are added to the RGB values of the dust particles), so it's likely the combination of your fog and the dust colour causes it to turn pink. To fix this you should change the colour of your dust particles, or change the colour of your fog.

    If reducing the nebula particle count reduces the graphical quality too much, then you should make it so that approaching it causes it to fade out, and instead the background/fog colour fades to match the colour of the nebula, that way the fillrate is kept low and you still get the appearance of entering the nebula. I believe this is how games such as Freelancer handle this.
     
  17. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    I left you a lovely review on the asset store, I recently had to start my project fresh and now I am getting this message ea time I save,

    Cleaning up leaked objects in scene since no game object, component or manager is referencing them
    Material Hidden/SGT/Starfield/Variant has been leaked 1 times.

    any idea?

    thanks
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Strange. I just looked through all the material code for starfields and it seems fine. Are you using the latest version of SGT?
     
  19. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Strange indeed,

    I just shut down the computer and started it again now the message is gone... had me worried for a minute,

    anyways its problem solved now,

    thank you :)
     
  20. WarpB

    WarpB

    Joined:
    Nov 12, 2013
    Posts:
    14
    Thanks for the reply Darkcoder, and I think I see what you mean. I also have an old 3GS, and the dust clouds and nebulae are the first thing my 3GS handles better than the iphone4! I forced the iphone4 to 3GS resolution last night and it immediately ran them just as well.

    Unfortunately the difference is so severe it means they seem pretty unusable on iphone4 unless I force the lower resolution. Although... I also tried having a fairly low quality nebula in the background, quite a long way from the camera, and this also killed the iphone4, even though all the particles were a long way from the camera and not taking up too much real estate on the screen, so I don't think it's only an issue when they are up close.

    I will continue to experiment.

    It beggars belief that Apple decided to release a new phone with the number 4 in it, with double the resolution, without upgrading the GPU o_O

    From what I've tested so far rocki, the star fields, asteroid rings and planets all work very nicely, I've added all 3 to my game with minimal hit to my FPS, but the infinite dust fields and nebulae drop the iphone4's frame rate dramatically, unless you force it to non-retina resolutions. But that does mean you can add them and test them in your game at lower resolutions at least! The fact I can use them on a 5 year old 3GS suggests any modern device will have no trouble at all using space graphics toolkit :)

    EDIT: Thought I'd mention as a tip... originally I hoped to use the nebula and starfields for my backgrounds to replace my skybox, but due to the limitations mentioned above, I've ended up removing all the stars from my skybox textures, and rendering a starfield on top of it with the starfield render cue set to 2501. This way I can greatly reduce the resolution of the skybox, which is just blurry spacy gassy nebula stuff, but still have nice sharp stars over the top of it. I'm using the awesome free Spacescape http://alexcpeterson.com/spacescape to generate my skyboxes, which gives me the ability to leave out the stars.
     
    Last edited: Mar 31, 2014
  21. aureliocalegari

    aureliocalegari

    Joined:
    Dec 26, 2012
    Posts:
    20
    Hello,

    I'm still on version 2.7.x and the roadmap in the above page is from 2012... Just wondering if there's any plan for introducing Comet trails and blackholes...

    Cheers
    Aurelio
     
  22. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    @WarpB,

    Thanks for the research. Very helpful.

    "I also tried having a fairly low quality nebula in the background, quite a long way from the camera, and this also killed the iphone4, even though all the particles were a long way from the camera and not taking up too much real estate on the screen, so I don't think it's only an issue when they are up close."

    @ DarkCoder
    "nebula is close to the camera then it might be rendering 5 or more full screen particle quads,"

    From WarpB findings, it seems that this might not be the case. Can you check to see if there are some other possible problems that might be causing the high fill rate. Would be awesome to have Nebulas and dust clouds working well without resorting to work-arounds.

    Cheers.
     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Yes, but it'll be a while before I add new features like those. Right now I'm still experimenting with version 3 of SGT, and the main thing I want to focus on is making it a lot more flexible (e.g. allowing you to apply atmospheres to terrains that use custom shaders), making more of the features modular, etc.

    As for black holes, I made an accretion disk component a while back that I can send to you (or anyone else) that wants to try it. It's not part of SGT yet because it's a bit of an experiment with Unity 4's way of doing things.


    @WarpB rocki

    The only thing that can cause high fillrates is if the camera is close to a bunch of particles. The dust nebula shaders themselves are fairly simple, so unless you remove the distance based fading there isn't much that can be optimized there. The iPhone 4 (not 4s) has pretty abysmal shader performance compared to most of Apple's other lineup (as seen HERE, not to mention 4x the pixels as you pointed out), so you probably should just cut the resolution down.
     
    Last edited: Mar 31, 2014
  24. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    @darkcoder, wish you could make an example scene like this:
    we control a ship, and we travel from different waypoint( base, asteroid field, other ships,orbit a planet,...) depending on our position, object scales up/down and disable renderer.

    kind of eve online travel system, i could not find anything close to it in your demos
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    I didn't make an example of this because there are multiple ways to implement it, each method is quite difficult to set up and use, and each method has its drawbacks.

    In your example, the easiest method would be to create multiple scenes on top of each other, but only have one visible at a time. So when you warp out of one scene, you're actually travelling very far away (e.g. 100000,0,0), swapping scenes, then teleporting the ship to the other side of the scene (e.g. -100000,0,0), and warping back to 0,0,0. This should work quite nicely.
     
  26. dilbertian

    dilbertian

    Joined:
    Aug 13, 2010
    Posts:
    74
    I was just wondering how the star fields are displayed (eg via Unity Skybox) and if via quads, how they look in Oculus and what the distance limitations are for scene in order to stay within their bounds.

    Are there any YouTubes to demonstrate how some of these scenes look in the Oculus?

    Are there any specials/sales coming up in the Unity Asset Store on this package anytime soon?

    Thanks,

    -Tim
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    The starfields are rendered using quads that face the camera, so they should look pretty good as long as you're not extremely close to them (as the parallax would break a bit). I know some users have made Oculus demos with SGT and I don't recall any of them having issues with the starfields.

    I don't have an Oclulus device myself so I can't test it, and I haven't looked for any videos showing it off. Maybe someone knows of one?

    SGT was selected for the 24hr sale last week, so I doubt it'll be in any sales for a while.
     
  28. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    I would like to try it .
     
  29. Exbleative

    Exbleative

    Joined:
    Jan 26, 2014
    Posts:
    216
    I've just had a quick google to see if its possible to have multiple suns/stars lighting planets, but didn't see anything. Would love to see this!
     
    Last edited: Apr 4, 2014
  30. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Not in the current version, as there isn't enough room in the shaders to add multiple lights. But it's something I'll investigate for the next major release.
     
  31. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    No pressure, only need ETA on version 3.0 for project planning.

    Cheers.
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    I have no idea how long it will take, as I need to experiment a lot with each component to find the cleanest, fastest, and most flexible implementation. As a wild guess I'd say 2-3 months, but there are many factors I can't plan for (e.g. new versions of Unity being released, my other projects/products needing work, etc).
     
  33. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Perhaps incremental updates will be better instead of the whole 3.0

    The reason is that 2-3 months would mean that the asset would have not be updated for a total of 5-6 months. Such a long time between updates doesn't give a good impression for potential customers. I don't know about others, but for me smaller updates would be much better. If anyone else has thoughts on this, please jump in.

    cheers.
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    I still maintain copies of all SGT releases, so if someone finds a bug then I can upload a fix relatively quickly (I've done this in the past).

    The reason why I won't incrementally release SGT 3 is because the updated components won't be compatible with the SGT 2 versions. For example: to make a star with a glowing atmosphere in SGT 2 you would add an SGT_Star component to an empty GameObject and set the fields, but in SGT 3 you'll make a normal textured sphere and then add the SGT_Corona component and set its fields. This change makes creating stars way more flexibile (e.g. you could add this glowing atmosphere to a voxel terrain made from a different plugin), but it would break compatibility with all scenes and prefabs that used it. If I did this every few weeks then I imagine many of my customers would be pretty disgruntled, so I think drawing the incompatibility line at one specific version makes everyone's lives easier.
     
    Last edited: Apr 4, 2014
  35. BES

    BES

    Joined:
    Feb 26, 2013
    Posts:
    212
    Nice!, thinking about the customers... thanks.
     
  36. greenmonster

    greenmonster

    Joined:
    Jan 18, 2013
    Posts:
    26
    Here's a short one! https://www.youtube.com/watch?v=s3hMUxdRrBU

    This is using your Starfield component to lay down stars from HIPPARCOS data + a bunch of fainter random background stars + Milky Way band as backdrop. Hard to see in the video I'm sure (even at 1080p), but they're very obvious in the Oculus Rift since your eyes are basically in a small dark room.

    Thanks again for SGT, Darkcoder.
     
    Last edited: Apr 5, 2014
  37. Deleted User

    Deleted User

    Guest

    Hi guys,
    I want to modify gas giant lighting gradient so i use:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class Test : MonoBehaviour {
    6.     void Start()
    7.     {
    8.         GameObject item = new GameObject("GasGiant");
    9.         var gasgiant = item.AddComponent<SGT_GasGiant>();
    10.  
    11.         var lighting = gasgiant.AtmosphereLighting;
    12.         lighting.AddColourNode(Color.black, 0.45f);
    13.         lighting.AddColourNode(Color.white, 0.8f);
    14.     }
    15. }
    16.  
    But when I start the play mode in the Unity, i see in the console:
    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. Test.Start () (at Assets/Scripts/Test.cs:11)
    4.  
    How to fix this?
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Open up SGT_GasGiant_Properties.cs and find AtmosphereLighting's get method (should be line 222).

    Modify it so that it becomes:

    Code (csharp):
    1.         get
    2.         {
    3.             if (atmosphereLightingColour == null)
    4.             {
    5.                 atmosphereLightingColour = new SGT_ColourGradient(false, false);
    6.             }
    7.             return atmosphereLightingColour;
    8.         }
     
  39. Deleted User

    Deleted User

    Guest

    Thanks,it works now! ;)
     
  40. Deleted User

    Deleted User

    Guest

    Hi Darkcoder...again :D
    I need to modify starfield component so i can:
    1) interact with each star (or more precisely quad)
    2) access to their scale,position. I mean that i need to locate each star in a certain place not randomly.
    My main problem is that I cannot figure out what exactly i have to modify:(



    Can you guide me in the right direction?
    Thanks.
     
    Last edited by a moderator: Apr 10, 2014
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    It's not so easy to do, because the star data isn't stored inside the component (it's in the generated meshes).

    If you take a look at the GenerateStarMesh method inside SGT_Starfield_Procedural.cs then you can see how the vertex data is laid out. The star positions are stored in the mesh.positions array, and the sizes are part of the mesh.uv1 array. If you don't need write access to the star data, then you could add an array of star positions and sizes to the SGT_Starfield class, and populate it within the GenerateStarMesh component.

    The only reason why I didn't do this in SGT is because storing large arrays causes the inspectors to run incredibly slowly, and it would take up a lot of scene memory.
     
  42. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    My understanding was that the starfield use almost no memory? Maybe I dont quite understand all of this but:

    "say goodbye to 2048^2 skyboxes, there are better resolution and use almost no memory"

    $bfbd3d7c-321d-4d2f-9ecc-f0c3051bdebb_scaled.jpg


    While checking the stats I was so mind boggled at wth increasing my tri's and verts so much, after deleting everything and realizing only the starfield was left I felt dumb,

    here's my question now,

    To use the starfield I need at least 5,000 stars so it looks nice.

    If I use 5,000 stars the tris go higher by 10k. and the verts by 20k,

    this is a mobile game I am creating for android / ios, can you please explain the impact as in Total before the startfield I barely reach 20 K of verts and 20 k of tris...

    Maybe I need a clarification on this and how it impacts the performance, what is ok and what is not?

    I mean, I had 10,000 - 20,000 stars before and I noticed 80+k added onto, got kind of scared.

    What does almost no memory mean than?

    I would love a kind, thorough explanation of all the impacts and clarifications here,

    thanks :)
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    As you notice, each star is a quad (two triangles, 4 vertices). This means that the memory required to draw a starfield is the mesh data size + the texture memory size. All the stars in a starfield share the same small texture (say 100kb), so the rest of the memory required to draw a starfield is about 50bytes * star count, which is probably hundreds of times less than the skybox equivalent.

    Of course, the vertex shader load does increase with the star count, but in my experience this hasn't been such an issue on mobile devices because the typically lower resolution means you can get away with smaller, larger stars. Ultimately, you should really test this on the devices you want to target, using the star settings (count, size) you want, and determine if the performance is viable alongside the other features your game needs, as this isn't something I can answer.
     
  44. Maskawanian

    Maskawanian

    Joined:
    Mar 5, 2014
    Posts:
    6
    Hey,

    If I wanted to have an object receive lighting from a SGT_LightSource (in my case a space ship). I assume I'd have to use a shader like "PlanetSurface/VariantNormal" or something. I would then have to update starDirection to a quaternion pointing towards the star from the object's current position. Is this the right approach or would you recommend something different?

    Thanks
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    You can just attach a normal Unity light to the SGT_LightSource containing GameObject.
     
  46. pirveli

    pirveli

    Joined:
    Apr 22, 2014
    Posts:
    2
    Hi,
    first I'd like to say that I really enjoy SGT. Amazing work :) I have a question: is it possible to change the center of free orbit camera? I have a Solar system and like to switch this camera between planets. I'm rather new to unity3d so I don't know much.

    thanks
     
  47. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    Yeah, just attach the camera to a different GameObject and it should now orbit that one.
     
  48. pirveli

    pirveli

    Joined:
    Apr 22, 2014
    Posts:
    2
    Ahhh, of course. Thanks :)

    cheers
     
  49. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    Returned post validity after more understanding of the asset, see below.
     
    Last edited: Apr 24, 2014
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,414
    You're right, the thruster component is more complex than some of the other components, but that's only because I wanted to give users maximum flexibility. If you take a look at what the thruster scripts do then you'll see they're set up to automatically fire based on your desired movement or rotation, which is a very useful feature. Sure, I could have made the script really simple by having a few predefined thruster groups, but I don't think users would find that very useful.

    As for the component errors, it's possible that I changed the variable names somewhere along the line causing thruster compatibility to break. But anytime I made changes like this I made sure to update all the demo scenes, so I'm not sure where you'd be seeing those errors, especially since SGT doesn't come with any thruster prefabs.

    There is indeed an update in the works, but I'm still very happy with the current release. Maybe you can post more info on this 'amount of bugs' that makes it unusable on mobile?