Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    Yes, I know using Designer would take a bunch of hair pulling just to get something that resembles a planet texture.

    Prob is, I also tried using LunarCell yesterday and while I was able to get something out of it, it certainly didn't look good IMO, especially compared to how the sample planets supplied with SGT look.

    In particular, I wasn't too happy with the normal map either using Bitmap2Material and letting that generate one for me.

    Admittedly it was my first attempt, so I won't beat myself up too bad about it, but I'm not sure what other tool to use that generates maps that correctly map around spheres.

    -Will
     
  2. Azaphrael

    Azaphrael

    Joined:
    Nov 17, 2011
    Posts:
    41
    The sample planets in SGT are actual NASA images, so you will have a hard time replicating something that good in an artificial way.

    LunarCell is not too bad, but you'll have to spend hours tweaking values to get a handful of decent textures out of it, same with Substance Designer. Though once you get the hang of it, it can produce some satisfying results. Just be prepared to dump a lot of time into it.

    There is LibNoise, which you'll have to compile yourself, but produces very good earth-like textures. Of course this is no solution for on-the-fly generation, as it literally takes minutes to generate one texture of decent size.

    One option of course is to draw the textures yourself (or get them drawn by an artist), from scratch. This will yield the best results. But it's very time consuming (or expensive) and naturally, it's not suited for generation at runtime.
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043




    I've been giving the starfield component some attention, and it has a few cool new features:

    • Star count limit removed
    • Added tweakable constants to some of the distribution types
    • Added the 'Elliptical Galaxy' distribution type
    • Added the ability to edit individual star properties

    As well as some changes to other things:

    • SGT int/float/vector inspector fields can now be click+dragged (like they can in the default inspectors)
    • Undo support has been improved when doing certain things (mainly involving meshes)
    • Multi object editing now supported



    I still need to add an 'add/remove star' button and create some new star images, but the results so far are very nice I think. With the new tweakable constants you can set it to generate more stars near the horizon which makes it look more like you're in a galaxy. Combined with a skybox/sphere of a galaxy's dust clouds this could look very good.
     
  4. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    Yeah, I'm not worried about on-the-fly generation, my planets will be etched in stone (pun intended) as far as I'm concerned.

    Granted, IF I could say come up with a good Substance based planet texture material with a nice set of tweaks, then bully for me - I'd actually surprise myself with that one!

    I don't mind a long process as long as the quality is good and the workflow is repeatable - I'll work with LunarCell some more.

    Shame Terragen doesn't create map exports, I have the pro versions of Bryce 7 and Carrara 8, maybe I can find a methodology of getting maps from those - have to experiment...

    BTW, what is the Detail texture slot for? Should it be grayscale like a bump map or is it for additional color information?

    -Will

    PS - re v3.x - AWESOMEOSITY!

    PPS - Is it possible to add some kind of control for pointed stars (e.g. 3,4,5, etc., points) and/or perhaps some randomly generated based on brightness / closeness?

    I know stars are round and yours are gorgeous compared the ones in my lo-res tileset, but I still like that look of points coming off some of them (like lens flares) for the added visual beauty.

    PP(x) - Okay last one - thinking again, I guess the star streaks/points would be drawn in the tile set and selected though your star editing?

    If that's the case - say I create 24 stars in my set BUT the last 4 stars have streak/points, could I somehow tell SGT to only randomly select from the first 20, leaving me (in this case) the last 4 to edit in manually?
     
    Last edited: Jan 3, 2013
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Right now it's just multiplied with the surface texture, so it can either be grayscale or colour. Also, for the next version I've moved the detail repeat variable from the surface tessellator component to the planet component, so you can control the detail map tiling without using the surface tessellator.


    The next version will include additional starfield tile sheets, of which some will have spiked points. But I won't create an in-editor way to generate these images from normal ones, as you would be able to get much better results from doing it by hand.

    Could you explain what you mean by: 'and/or perhaps some randomly generated based on brightness / closeness?'
     
  6. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    I dropped that thought about the streaks being randomly generated based on brightness/closeness in my PP(x) edit when I realized it would be best to draw the streaks within the tile set(s) - just as you mentioned.

    The remaining question is limiting SGT's selection of the pointed stars in some way? I see you're saying now multiple tilesets will be allowed - eff'n excellent!

    If I have say 2 tilesets, one for "normal" stars and the other ("special stars") containing streaks / points etc., could there somehow be say a percentage control (e.g. 2%) which when generating 100 stars, only 2 out of the streaked tileset would be used?

    OR are you setting this up so that the "first" tileset is the one SGT selects from randomly while the 2nd set is only shown though manual placement?

    -Will

    PS - Reading again, I think perhaps I misinterpreted your comment about adding the use of additional tile sheets - perhaps you meant you're just going to include additional star tile images with SGT v3.

    If so, my question still stands how to limit what stars SGT pulls from the tile sheet randomly?
     
    Last edited: Jan 3, 2013
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Well, I will be adding texture atlas generation, so allowing you to combine multiple tilesheets is really easy.

    Controlling how many of each type of star that gets generated is an interesting idea. But I wonder if it's enough, what if you wanted stars with a certain texture to be larger than the others? Or pulse with a higher rate than the others? Right now you can achieve this using multiple starfields, but I suppose I could give you that kind of control.
     
  8. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    LOL at this point you're going to have to create a spin-off product - Starfield Commando!

    If I had my druthers, I'd have say 4-texture slots; this would allow me 1 - 2 "normal star" textures, slots 3 4 would be my streaked stars and perhaps some special items - star bursts, nebulae, galaxies etc., or if 4 is limiting, then an array setup where you click a button to add a new texture slot, similar to other array properties in Unity.

    Maybe at the slot level you can add additional control for pulse rate, scaling etc. Following your thought - sure I could end up with just one star in a slot BUT I'd have full control over it (based on what features you decide to expose) compared all the other slots.

    One parameter I feel is required is a display percentage of some sort where to total must add up to 100%; for example, stars from slot01 could be assigned 70% chance to display, stars from slot02 could be assigned 20% and slot03 would automatically get filled with 10%. Changing the values in one slot would always readjust the display percentage total among the other slots so 100% is maintained. (0% would mean no display so perhaps the minimum should be clamped at 1%?)

    This way, using my tile set example above, I could have my normal stars in slot1 which would get chosen 98% of the time and slot2 could have my streaked / pointed stars which get displayed the final 2% all chosen randomly by SGT.

    I will admit though, there will probably be times where I want a slot to display 100% of the time regardless of the other random selections. I guess a checkbox "Always Display" could be ticked to remove that particular slot from SGT's random selection routine.

    The question then is do I still want random selection within the multiple stars in that slot, OR will that 100% slot always get limited to ONE star only?

    Your call; I'd imagine though you'd have to refactor your random selector to something which is used individually by each slot instead of globally...



    Then it would just be a matter of tweaking the seed to get just the right look for the scene at hand...

    I could then easily recreate what I did above but using your much better looking stars along with whatever specials I put into other slot(s).

    Good stuff all around - especially if I can then edit positioning and other attributes of each star as you alluded to earlier - BIG BANG!

    -Will
     
    Last edited: Jan 4, 2013
  9. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    709
    Hey, I am looking forward to purchasing this very soon!

    Keep up the awesome work!

    EDIT: BTW - Is this Multi-player compatible out of the box?
     
    Last edited: Jan 4, 2013
  10. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Wow, your really going to town on the star stuff. I like it! I have to wonder where you are breaking things out so much, if you would be able to single out a star and make it selectable some how. A check box would be nice. :)

    My thought would be to use an image of a planet or a galaxy and be able to mouse over it and get information . Then something like a shift click could navigate to it via a space jump scene change.
     
  11. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    I won't add in any arbitrary limitations like 4 texture slots. Instead, you will be able to add as many tile sheets as you like, then under that there will be an expandable list for each star type with individual settings that are based on the global star settings (the ones you currently have access to). Each star type will then have a slider indicating the percentage chance of it appearing like you mention.

    If you only need one of a specific type of star, then you can just use the starfield editing feature to add your own.

    I'm not sure what the purpose of your proposed 'always display' feature would be though?

    As for the random selection, the original tile sheets would no longer matter at this point, because the stars would be extracted from them and treated separately.


    Thanks! I have no idea if it's multiplayer compatible, maybe someone in this thread has tested this? I was under the impression that Unity's multiplayer was separate from everything else, (except the RPC functions?) so I can't really think why it wouldn't work. However, I haven't tried Unity's multiplayer functionality yet, so it's not something I can test so easily, so you'll have to wait a while before I get around to testing this.


    You can select planets by just raycasting the surface, but selecting stars in the starfield is much harder. I'm not really sure the best way to do it; you'd have to perform your own raycasting routine into the star position list and find out which is closest to the mouse. You can't just generate a mesh collider from the starfield mesh because the actual mesh position data is flattened to a single point and would be useless when raycasted.
     
  12. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Would there be any way you could target the "position/size etc data" and have it create a small mesh collider that could be raycasted?
     
  13. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    If the starfield is marked as In Background, and with a bit more code, yes. In addition, the built in raycasting feature will return the hit triangle ID, so it's even possible to create a single mesh collider with many stars. However, this wouldn't work with starfields that aren't In Background, because as the camera moves, the stars rotate to point at it and eventually the rays wouldn't be able to hit the collision mesh for the stars. You could get around this issue by giving the stars a cube as the collision mesh, but that won't get around the biggest issue with this: generating mesh colliders is really really slow.

    Ultimately, the best method in terms of performance is writing the custom raycasting routine as I hinted at above. But I have no experience writing anything like that, nor do I know the theory, so don't hold you breath waiting for me to implement this. In the mean time, I'll add methods to retrieve the star position data so that users can implement their own picking routine. I won't implement the mesh collider method mentioned above because it's not practical at all if your scene contains thousands of stars (of which all the example scenes do).
     
  14. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    I understand that your not looking to add this which is ok. I think Version 3 is going to rock. Much like 1 and 2. I am wondering if you realize that I'm only looking for 6 (maybe a few more) different way points in the background that will load another scene/sector and not thousands.
     
  15. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Indeed, but in this package I want to try and avoid writing features that don't scale well. Writing a star picker as you describe is fairly easy, and would work very well across all devices with maybe 100 or so stars. But I can already imagine the complaints I'd get when people try and enable such a feature on a starfield with 10k stars. That said, I would have no problem releasing such a script/component in this thread, but you'll have to wait until after the next release.
     
  16. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Not a problem. If you can then great, if not I'm sure I can find some way to go about it. But yes that does kinda sound it could become an issue but then again I suppose anything could. Either way thanks for your replies.
     
  17. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    Interesting idea on the concept of simply selecting a star to "travel" to!


    For my game, I plan it to be heavily navigation console based.

    Now with that in mind, what would be cool to me is if the full starfield could be rendered to a texture OR some kind of "holo-display globe" where you can make those typical rotatable, scifi holographic map displays that look suspended in the air etc!

    Now that would be cool! A small, rotatable render of the current star field that you could then select the active (game selectable) stars for navigating to. Ideally out of 100's to 1000's of stars in a scene, only a handful will be game'able - selectable within the scene for traveling to. Thinking further, just a rotatable map of only the selectable stars would good enough as well!

    I used to love the 3D maps in the game Ascendency and always wanted to do similar.



    Well I'm glad to see you're opting for the atlas method - so that sounds like it means I can load stars (and other graphical objects) of various sizes and they all become individually controlled?

    What I meant by always display at the time was just a statically displayed object; no pulsing etc., by SGT and I guess by extension, manually placed where I wanted it to show up (for galaxies, nebulae, star bursts etc.) Everything else would have been randomly placed and controlled by SGT.


    I'ma just have to wait and see your new setup.

    It looks to me like you're setting up something where every star (within reason) can be directly controlled which is again amazing to me - I'll have to wait get what you've done in my hands to see I can accomplish with it.

    I believe you got the jist of what I wanted to accomplish and I believe what you're planning to deliver will allow me to do that and way more ultimately...

    -Will
     
  18. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    709
    Hey, Is this android compatible?

    EDIT: Just read the front page of this post. Should have done that sooner...

    EDIT 2:

    Just curious - What is the performance like on Tegra3 android devices?
     
    Last edited: Jan 5, 2013
  19. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    You can already make a holographic starmap easily enough by just duplicating your starfield and unchecking In background. If you want your holographic map to have less stars than your actual starfield background then you can just reduce the star count, because changing the star count won't modify the positions of existing stars. But you'll have to wait for me to allow you to select stars.

    Yes, you will be able to manually control all aspects of each star type, but the values will be percentages/sliders based on the global settings you currently have access to, so setting up a starfield should still be very easy.


    I don't have any Android testing devices to test with so I'm not sure. Maybe someone in this thread can chime in?
     
  20. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394

    OMG DarkCoder! Do you know HOW MUCH TIME you've saved me, and FEATURES you've added to my game with just this alone??

    I've never tried the star field with the background unchecked - this is eff'n awesome! I'ma have to actually rethink the navigation portion of my game now cause I didn't even expect to have a rotatable galaxy / quadrant map like this!

    For the inner-system maps, besides the primary star(s), I can just load a tile set with planetary and space station objects and SGT will let me rotate that around as well - you've brought tears to my eyes DC!



    Now I'm wondering how I can place a small representation of my ship within that star map that actually tracks my position within the system. That just may be a fudge it till it looks right kinda thing I guess...

    In fact this star field of yours would make a great radar display IF instead of displaying randomly placed stars etc., it could dynamically grab the positions of stuff in the scene relative to the observer (with filters to ignore unimportant stuff) and display them at their proper spacial positions relative to each other within the map!


    I did grab an Android Basic license when UT had the give away and I upgraded it for v4 BUT I have yet to ever try an Android build.

    It may be a while but I will put it on my list to test all this (and building to Android) when I get to the point of having something solid.

    Right now everything I've done so far has been "can I do this, can I do that..' kinds of test scenes with the add-ons I've purchased.

    -Will


    PS - I just now quickly tried unchecking background and hiding the planet I had at 0,0,0 - YES, the star field was right there at world center!

    I then turned on the rotation tool, but when I rotated the star field around in Y, the X and Z positions changed and the star field rotated around with an offset instead of at 0,0,0?

    I changed the mode to In Sphere instead of On Sphere and that gave an even better look for this purpose!

    After that change, I then dragged the Y rotation value in the inspector this time instead of with the GUI widget, the X/Z position doesn't change in the inspector BUT looking at the star field in the view still shows an offset rotation?

    Admittedly a minor quirk at this point, but this however is absolutely awesome - off to model some new concepts of my Navigation Console!
     
    Last edited: Jan 5, 2013
  21. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131


    And there was much rejoicing!!!

     
    Last edited: Jan 5, 2013
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Interesting, I haven't noticed this issue before. What happens if you toggle In Background on and off again? The code that handles toggling In Background is pretty simple and I can't really see how it would fail (famous words before a programmer facepalms).
     
  23. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    All I did was as you suggested, I unchecked the Background button of my "SkySphere" object and hid my singular test planet since they were both located at 0,0,0. (At first I didn't see the stars after unchecking BG, but then realized the planet was perhaps covering it.)

    I then clicked Unity's rotate button and dragged on the green ring.

    Just now I tried again, I'm noticing if I click the button PIvot/Center, I can get the rotation centered where the sky sphere if the "Pivot" button is visible. (I forget whether the button is ON if the name is displayed OR if the currently active button is the name that's NOT displayed?)

    I can always make a screen capture video or pics to show you if you can't reproduce it yourself. I do also have an SGT_Skysphere script added to the SGT_Starfield script on the game object (in that order.)




    As a side note, and as I mentioned to Distant Temples in private chat, Wing Commander Privateer has ALWAYS been my source of inspiration for my game.

    I'd be surprise if all of the folks here don't already know about Star Citizen but Chris Roberts is at is again after letting it go for over 10 years - he's creating a new Wing Commander type game:

    Star Citizen

    I'm posting this link as inspiration for ALL of us here because apparently we all seem to have the same passion for these kinds of games!

    I can't imagine ANYONE seeing Chris Roberts' 11 minute Star Citizen intro video NOT to be inspired by what's going into this new game!


    Even though I could give up on my game now since Roberts is currently making the game I've always wanted to make, I've been forced to CONTINUE on with my game since Space Graphics Toolkit along with DarkCoder's help is SO GOOD, that, I can almost see the finish line for my game now thanks to the help of his programming!

    Looking at that Star Citizen game, and thanks to SGT, looking at mine, as far as the space scenery, I'm seeing a LOT of similarities!

    I still may have some reserved wishes for improvement with SGT's asteroids since I also consider my asteroids to be a major "character" in my game; navigating though them, (and getting hit by them) is a serious part of my game design! (I want to my asteroids to explode and/or break apart when they collide or get cut with a mining drill for example...)


    But for the most part, I think I can see the end which has never happened before! The rest is pretty much up to me now!


    So once again, thanks DarkCoder for all your help!

    -Will
     
  24. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    Hello there, got problem with mobile devices. Planets gets "filled" as camera distance inceres

    $device-2013-01-06-011911.png

    $device-2013-01-06-011815.png

    $device-2013-01-06-011836.png

    Can this be a render distance in scene settings for mobile? I'm watching that sun from 10k+ units
     
    Last edited: Jan 6, 2013
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    If your rotation gizmo is set to Pivot, then it will rotate your selected game object around its transform.localPosition, and ignore all the children.

    If your rotation gizmo is set to Center, then it will check the size of every game object inside your selected game object and find the middle/centre and rotate your selected game object around that. This may result in both the rotation and position values changing on your selected game object.

    The SGT_Skysphere component works by creating a child game object with the skysphere mesh, and it positions this game object at your main camera's position every frame. This means that if you have a game object with a holographic starmap and a skysphere attached, the Center rotational gizmo will rotate your game object around the point between your starfield and the main camera, which will not be at the middle of your starfield.

    Does this answer your question? If so, to make life easier you should probably put your holographic starfield in a separate game object and maybe attach the skysphere to your camera.


    If anything, seeing such good quality games coming out gives us more inspiration to make one of our own!


    Right now, the SGT_AsteroidRing component is designed with rendering speed in mind, but in a future version I will greatly enhance their usefulness.



    If your planets are disappearing as the camera moves away from your planets, then you may need to increase your camera's far clipping plane. You can adjust the draw range from your camera's settings: Clipping Planes > Near Far. Keep in mind that some mobile devices (e.g. iPhone 3GS) use a lower precision depth buffer than other devices, so you will have a more limited draw range.

    One alternative is to make your scene smaller (i.e., scale down your planets and move them closer to the middle), but this won't really solve the depth buffer precision issue.

    The best solution is to move far away objects closer to the camera and scale them down. For example, if your planet is 10,000 units away from your camera, you may want to position it 5,000 units away, this is half the distance, so you should scale the planet to 50%.
     
  26. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    I have a mainly 2d game and need to find a way of placing vertical bands of asteroids down the left and right edge of the screen to denote where the player can not move into. The player constantly moves up the screen.

    Rather than the asteroid rings, is there's a way I could use this component to achieve that? Also,I am currently using the star fields but they are based on placement around a 3d ball. Is there a more efficient 2d method I could use?

    Thanks
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    There's no decent way to do that using SGT right now, because that's not a situation I considered. However, Version 3 of SGT will include a component that will spawn stuff around the camera (e.g., dust clouds/stars/asteroids/etc). I'll see if I can also implement a way to constrain the spawning locations, that way you could use this to create map boundaries like you need. But right now I'm working on a few different features so you may have to wait a while.

    If you're using the starfield component right now, then you could try changing the Starfield > Distribution inspector field to In Cube.
     
  28. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    Great thanks.

    If I change the distribution to a cube, then just align the camera with the back or front wall, would there still be a way to rotate the stars?

    I currently slowly rotate the star fields in different speeds by spinning them in X.
     
  29. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    When you say rotate, do you mean to give them the illusion of movement through space? If so, a cube distribution probably wouldn't look that convincing. But besides writing your own code for this, or waiting for Version 3 of SGT, there probably isn't a whole lot you can do with the existing features to make it look that good.
     
  30. steddyman

    steddyman

    Joined:
    Apr 10, 2009
    Posts:
    253
    I spin the balls so to speak :)

    Ok, no problem. It does actually look good as a sphere... you don't see curvature at the right camera angles.

    Thanks
     
  31. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19

    I found issue its caused by atmosphere component! Disabling it fixes that but well then planets dont look so cool :)

    And when you scale down objects distance at with this happens decrese alot! So its even worse as it was that way :)
     
  32. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    Hi DC, thanks for explaining the fact that the current asteroids are designed to be more performant than anything else at this point in time.

    As far as the rotating star map, I thought that it was perhaps due to the fact I had the skyphere and starfield components on the same game object. I'll separate the two moving forward - thanks!


    -Will
     
  33. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Ah sorry, I didn't see your attachments originally.

    I have no idea what would cause that kind of a rendering defect, what device does this happen on?

    Also, could you tell me what your camera Clipping Planes settings are, as well as the distance between the planet/star and the camera?
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Didn't mean to double post!

    Even if they're on the same object, it should still work (I tested it earlier). But please let me know if this still gives your problems.
     
  35. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    Devices tested:
    Android: SGS 3 and Nexus 7 and Dell Streak 5

    Clipping Planes:
    Near = 0.3 Far = 10k

    I reduced size of planets and for example earth with radius of 5 this starts at distance of 250 units
    And earth is 263 units from Sun
     
  36. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Thanks, In the android player settings (File > Build Settings > Player Settings), If you select Use 24-bit Depth Buffer, does the issue go away?

    I will do some more experimentation on mobile devices, and hopefully this issue will be reduced.
     
  37. deadswine

    deadswine

    Joined:
    Mar 27, 2012
    Posts:
    19
    Tested that with nexus 7 and there is no difference
     
  38. Kafar

    Kafar

    Joined:
    Nov 29, 2012
    Posts:
    207
    Hi,

    I have 2 questions:

    1. Future update for users bought this actual version are free or not?
    2. Someone tried to mix this kit with Space Game Starter Kit?

    Thanks

    -Kafar
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    OK, I'll see if I can replicate this issue myself.

    In the mean time, try to make the camera's clipping planes as tight as possible. i.e., if your planets and stars are 10 units in radius, and 200 units away from the camera, your clipping planes only need to be around: near = ~190, far = 210~. Of course, the actual distances depend on what else you have in the scene, but clearly a range of 0.3 and 10,000 isn't suitable for those devices.


    Yes, all future updates are free.
     
  40. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    709
    Hey, Quick question,

    Do you plan on adding nebula and the like to the SGT?

    I am already sold on this product, Just I would like to see a Nebula or two.

    :)
     
  41. ZowPac

    ZowPac

    Joined:
    Sep 25, 2009
    Posts:
    58
    I've seen increasing the far clipping plane create distortion (I forget - might have started around 90000 for me). I found having smaller planet objects just made them feel small when you get close. To have some truly huge planets you can get close to and fly around, what I ended up doing was adding a second camera and corresponding layer that treated everything at something like 1/1000th scale - the planets can be at a size the camera geometry can handle, but you only move this camera 1 unit for every 1000 the "real world" camera moves. Of course, you have to make some invisible "real world" collider if you need that information...

    Edit: Ah, I see you said something similar a few pages back - that's what I get for just skimming through.
     
    Last edited: Jan 6, 2013
  42. ZowPac

    ZowPac

    Joined:
    Sep 25, 2009
    Posts:
    58
    Now for my real question - are there any pointers/examples for scripting SpaceGraphicsToolkit? I was looking to build a tessellated planet by choosing one of a collection of available textures and I'm getting a little bogged down in the class hierarchy with SGT_SurfaceTessellator.
     
    Last edited: Jan 6, 2013
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    I haven't written any examples of scripting the SurfaceTessellator yet. Mainly because I'm super busy right now, but also because I'm changing some more internal stuff so some of the identifiers will be different. But I can give a brief explanation.

    Make sure you attach the SGT_Planet component first, and the basic settings should be fairly easy to do because they're identical to the inspector:

    Code (csharp):
    1.  
    2. var planetGameObject = new GameObject("My Planet");
    3. var planet           = planetGameObject.AddComponent<SGT_Planet>();
    4. var tessellator      = planetGameObject.AddComponent<SGT_SurfaceTessellator>();
    5.  
    6. planet.SurfaceRadius = 100.0f;
    7.  
    8. tessellator.DisplacementScaleMin = 1.0f;
    9. tessellator.DisplacementScaleMax = 1.2f;
    10. tessellator.SurfaceDetailRepeat  = 100;
    11.  
    But setting things like the textures is more complex, because the amount of textures used depends on the Planet > SurfaceConfiguration and Tessellator > DisplacementConfiguration.

    If your planet's SurfaceConfiguration is set to Sphere, then you'd use something like this:

    Code (csharp):
    1.  
    2. planet.SurfaceConfiguration = SGT_SurfaceConfiguration.Sphere;
    3. planet.SurfaceTextureDay.SetTexture(yourCylindricalTexture);
    4.  
    If it's set to Cube:

    Code (csharp):
    1.  
    2. planet.SurfaceConfiguration = SGT_SurfaceConfiguration.Cube;
    3. planet.SurfaceTextureDay.SetTexture(yourCubeTextureNegativeX, CubemapFace.NegativeX);
    4. planet.SurfaceTextureDay.SetTexture(yourCubeTextureNegativeY, CubemapFace.NegativeY);
    5. planet.SurfaceTextureDay.SetTexture(yourCubeTextureNegativeZ, CubemapFace.NegativeZ);
    6. planet.SurfaceTextureDay.SetTexture(yourCubeTexturePositiveX, CubemapFace.PositiveX);
    7. planet.SurfaceTextureDay.SetTexture(yourCubeTexturePositiveY, CubemapFace.PositiveY);
    8. planet.SurfaceTextureDay.SetTexture(yourCubeTexturePositiveZ, CubemapFace.PositiveZ);
    9.  
    And then you'd use basically the same code for SurfaceTextureNight, SurfaceTextureNormal, etc.

    If your tessellator's DisplacementConfiguration is set to Sphere, then DisplacementTexture texture only requires one texture. To set this, you use:

    Code (csharp):
    1.  
    2. tessellator.DisplacementConfiguration = SGT_SurfaceConfiguration.Sphere;
    3. tessellator.DisplacementTexture.SetTexture(yourCylindricalTexture);
    4.  
    If it's set to Cube::

    Code (csharp):
    1.  
    2. tessellator.DisplacementConfiguration = SGT_SurfaceConfiguration.Cube;
    3. tessellator.DisplacementTexture.SetTexture(yourCubeTextureNegativeX, CubemapFace.NegativeX);
    4. tessellator.DisplacementTexture.SetTexture(yourCubeTextureNegativeY, CubemapFace.NegativeY);
    5. tessellator.DisplacementTexture.SetTexture(yourCubeTextureNegativeZ, CubemapFace.NegativeZ);
    6. tessellator.DisplacementTexture.SetTexture(yourCubeTexturePositiveX, CubemapFace.PositiveX);
    7. tessellator.DisplacementTexture.SetTexture(yourCubeTexturePositiveY, CubemapFace.PositiveY);
    8. tessellator.DisplacementTexture.SetTexture(yourCubeTexturePositiveZ, CubemapFace.PositiveZ);
    9.  
    You don't have to worry about setting the planet surface mesh data if you're using the tessellator, because they will automatically be written.

    Please let me know if this answers your question or not.
     
  44. Wudek

    Wudek

    Joined:
    Aug 10, 2012
    Posts:
    7
    Quick question, bought this last week, I'm loving it. Been trying to get highlighting to work on this, thought I could use my existing highlighting asset but it doesnt work off the bat.

    I'm guessing I'll have to dig into your shaders and change them manually?
     
  45. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    You don't have to edit the shader, one method is to create a new material for your highlight effect and attach it to the second material slot on whichever renderers you wish to highlight. I haven't tested this with SGT objects, but you should be able to just recursively go through the children of an SGT object and attach the new material to the renderers. Though I'm not sure what happens if you go inside/outside an atmosphere, because I swap the materials out using renderer.sharedMaterial, and that may cause it to remove any other materials.
     
  46. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    I have. I'm fairly new to working with 3D stuff at this level. I have been checking out both kits separately to gain an understanding on how they work. I have only just begun to incorporate them. So far I haven't done a lot with them together but I am liking both of them a lot. I still have much to learn though.

    Both seem to be very well written and support responses from both authors are very timely and attentive.
     
  47. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    DarkCoder, quick question - are you planning on exposing the X,Y,Z coordinates of the stars so we can implement Starlanes between them?

    Example (Courtesy of Ascendancy):


    If the star's coordinates were exposed, I could 3d draw lines between them on my navigation map.

    -Will
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,043
    Yes, I've already written methods to read or write individual star positions/textures/sizes/pulse rates/etc. They will be included in the next release.
     
  49. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    Thanks DC! Yews da mann!

    -Will
     
  50. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Hey Darkcoder , I was wonder if you have plans for a third person camera view? I really like how your camera system works. I'm just not having much luck incorporating a third person view and I would like to be able to have both in my game.
     
unityunity