Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    I'm wondering how well does it handle actual sized planets? Is the performance effected in any way? How many planets/objects can a scene handle? If it doesn't do well with actual sized planets what is a recommended size?
     
  2. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Although I am not using this pack yet, I render my planet textures using a combination of coherent noise functions.
     
  3. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Thanks fholm. I did pull a nice red rust texture and applied it to my one planet.
    Overall I really like the kit. Darkcoder gives you plenty of options of what you can do. Still waiting for his next upgrade but so far it is very good.
    Have my sun in place with two orbiting planets while I fly around in a spaceship the one planet has rings around it.
     
  4. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    Ok, very good to know - I am actually not going to use the kit like that, I merely need to visualize different planet types.
     
  5. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,052
    So decided to buy this, I suppose the pack is decent, but I'm kind of let down with the rendering, giving artifacts at the poles even for the textures that comes with the pack:

     
  6. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    How goes the update Darkcoder?
     
  7. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102

    @fholm : Read this..

    This is for a future update that he is currently working on. You can find more on page 2 under the Sneak Peak 2 post.
     
    Last edited: Sep 19, 2012
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sorry for the lack of activity this past few weeks, real life has been pretty busy here, but I should have more free time now.

    I do have a small update though:

    I've now added partial support for prefabs. That is, you can now create a prefab from SGT objects in your scene, then drop them into different scenes, or instance your prefabs from code and what not. I say partial, because you currently can't add an SGT component to a prefab in the project window.

    I also played around with the Copy and Paste feature in the editor and supporting it seems like a lot of hassle (because it forgets all local hierarchy references), so I'll leave it for another update.


    If you want to create somewhat realistic earth-like planets then the easiest way is to use a procedural generator for them. I didn't investigate this much, but I know that there's a Photoshop plugin called Lunar Cell which can generate planet textures. An alternative would be to download high resolution satellite imagery of random places on Earth, make a composite texture from them, and deform them into a cylindrical texture.

    I had originally included some planet surface textures made from cgtextures.com media, but due to Asset Store license reasons I couldn't include them in the final package. In a future release I may make some more planet textures using the methods outlined above, or ones made from my own pictures.


    It looks nice, if enough people complain about the documentation looking too boring then I may use this :)


    As Archania says, you can use any scale you like. But the coming version only supports a detail map and a colour map, so if you create a 1:1 scale Earth then the surface detail won't look that good when the camera is close to the ground. I'll try and expand the terrain shaders to include multiple texture maps, but I'm not really sure how much I can add while keeping Shader Model 2 support (mobile devices, lower end PCs, etc).


    As Archania says, you have full access to the source code.

    In the current version the planets are textures with a single equirectangular texture (like the default Unity sphere), but the next version will allow you to have 6 separate cube faces (this won't use Unity's cube map feature, but it's basically the same thing).


    It's based on that, yes. But due to shader instruction constraints and optimizations, I skip a lot of the calculations. For example, I don't calculate the in/out scattering of light, instead, the user specfies the colour at that point in the atmosphere. This saves a lot of GPU work, allows these shaders to work on mobile devices, and it gives the user a lot more control over the atmosphere colours, which I think is better.


    Yeah, as ForceX says, the next update will support cube textures to eliminate this problem. In the mean time, you could try using a surface mesh that isn't a geosphere (e.g. Sphere128, Sphere64, etc), these have more vertices in the poles, so you should see less polar distortion.


    Slow, but I can do a lot more work on it this week!
     
  9. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Glad to see you again. Ya real life has a way of doing that to you. Hopefully it will settle down for you. Go grab a cup of sake and relax lol.
     
  10. Aaron-Static

    Aaron-Static

    Joined:
    Sep 22, 2012
    Posts:
    4
    I cannot recommend this package enough. Truly amazing! Thank you for saving me probably a month or more of work getting my planets to look good.

    Heres a sneak peak of what I've managed to do so far:



    All textures apart from clouds (day, night, normal, specular) have been procedurally generated from a seed integer using only a few octaves of Simplex Noise and an erosion filter. I plan to "roughen" up the coastlines to make them look a little more realistic but so far I am very happy with the results your shaders are giving me.
     
  11. SNS_Case

    SNS_Case

    Joined:
    Oct 7, 2011
    Posts:
    58
    I'm severely tempted to pick this up even though I have practically given up on using Unity for creating a space "sim"... the demo looks stunning and so far the reviews have been very positive. Almost makes me want to create a mini-game just so I can fly around in space with these planets. :)
     
  12. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Looking very nice mate!

    Mike
    @runonthespot
     
  13. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Really like the planet and the GUI you have there Aaron! Hopefully this is one of many great looking planets you are planning to do.
     
  14. Aaron-Static

    Aaron-Static

    Joined:
    Sep 22, 2012
    Posts:
    4
    Yes am working on generating gas giants and non-habitable worlds as well. Will post a gameplay video in a few weeks to a month.
     
  15. WillBellJr

    WillBellJr

    Joined:
    Apr 10, 2009
    Posts:
    394
    If/when Darkcoder implements those Star Trek-esk animated star fields that whizz by your cockpit window when your ship is in motion I'll be completely straight then...

    Great stuff for sure!

    -Will
     
  16. Ocid

    Ocid

    Joined:
    Feb 9, 2011
    Posts:
    476
    This looks awesome Darkcoder.

    You should be really proud of this toolkit.
     
  17. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Darkcoder. Just seeing how the update is coming along. Hope everything is alright.
     
  18. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    How did I miss this thread? :eek:
    Nice tool.


    JP
     
  19. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Great things get past page one pretty quickly in this area! Darkcoder is doing a great job on this asset.
     
  20. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Great job my friend!!!
    Hope you are getting many sales!!!
    I'll purchase one for myself soon!!!
    Hey hey hey!!!
     
  21. limdorn

    limdorn

    Joined:
    Jan 5, 2012
    Posts:
    56
    Hi. I bought the SGT and it´s a very good pack but ... how can I create a prefab of a sun or a planet ?
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You can't in the current version, but I've added prefab support and will release the next version sometime soon.
     
  23. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Hey DC, This tool kit is great. I really like how you laid it out. I was wondering if you have plans to implement a map/mini map system so you can locate the planets and other objects in a large scene?
     
  24. nockieboy

    nockieboy

    Joined:
    Jul 7, 2012
    Posts:
    48
    Hey darkcoder!

    How goes the update? I'm uber-keen to get my hands on the latest update after seeing the teasers of planetary surfaces. Any update on when the update is due to be updated? :confused:

    Sorry to be a pain - I'd help if I could!
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Not really, because mini-maps aren't that strongly tied to space scenes, and they can have an incredibly vast amount of styles. Another important reason is because such a component wouldn't be very easy to use, and would require a lot of game-specific programming to handle everything (what if a contact disappears or cloaks?, or if a contact is current unidentified?, etc).


    Don't worry, I totally understand the frustration of developers not releasing updates in a timely fashion! One of the main reasons why it's taking so long and why I can't just give you an advance build is because the new update changes quite a lot of the fields in most of the component classes. This unfortunately means that any existing scenes made with this asset pack won't be compatible with the next update (i.e. you will have to recreate your scenes). To avoid this situation in the future, I will feature freeze the core of these components, but first I must make sure I haven't forgotten something.
     
  26. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    But they make it look so easy in the movies. :/

    Kirk: Hey Bones, how are we going to find our way out of this quadrant with the sensors down?
    Bones: Dam It JIm! I'm a doctor not a dam mini-map!
    Bones: What ever you do Jim, Don't use the map app on your iPhone!

    @Darkcoder:
    Your kit still rocks and I'm still very happy with what it offers now. And from the looks of the features you are working on this kit is going to be totally awesome. Thank you for all the effort you are putting in to it. The new features look to be well worth the wait.

    @Everyone:
    I'm not a coder. I can hack around code to customize things and sometimes they even work well. I've looked at some of the mini-maps on the asset store and they look like they are terrain based. So I'm not sure how well they will work for a space scene. I have the "Ultimate Mini-map" from the Asset Store so I'm going hack on that a bit. But what I would like to ask is, " What are folks here using for a mini-map solution with this kit? " Anyone using " KGF Map System? " Suggestions, ideas and thoughts are welcomed. Thanks.
     
  27. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    I'm using one that I combined a couple of others into one. I got it working ok for the space since I can assign different tags to plants or a space station or whatever I want. Only issue that I need to add to it would be a pointer system so it will point to the nearest thing. Otherwise you are just flying around.
     
  28. nockieboy

    nockieboy

    Joined:
    Jul 7, 2012
    Posts:
    48
    I'm using a minimap made by ForceX - it's brilliant. Does exactly what you want (I'm using it in a space game I'm creating), involves the minimum of fuss to incorporate into your project (read the instructions in the forum post) and best of all? It's FREE. ForceX is also great at replying to queries and technical questions regarding the minimap or anything else for that matter (helped me out with some GUI HUD components I was having trouble with.)

    So really I can't recommend it highly enough. Take a look and see if it works for you. :D

    @ darkcoder

    Thanks for your reply - I understand completely about wanting to get it all right and sorry if it seemed I was pushing you. I'm on no deadline so it really doesn't matter - I was just wondering. :)
     
  29. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131

    Wow Thanks. That looks like a great tool to implement into the UI. I'm still kinda stuck for a system that will map out a planet and show where you are located if you have landed on the planet. Have you seen something does that?
     
  30. OrbitusII

    OrbitusII

    Joined:
    Jul 4, 2011
    Posts:
    175
    On the subject of maps for something similar to this, I would recommend looking at ForceX's 3D Radar package. http://forum.unity3d.com/threads/79163-3D-Radar

    @DarkCoder: very very very very... nice work on this! When I can actually get the asset store working I'll be sure to get this!
     
  31. Cesiken

    Cesiken

    Joined:
    Oct 23, 2012
    Posts:
    1
    When are the next update coming out? It is just that I need terrain and surface features that is in the next version for a game I'm developing (You should be able to travel to different planets and explore them etc) So, Is there any planned release date? I've just been waiting for so long! :D
    (BTW, I love this!)
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The release date for the update hasn't been decided yet, but I've sent you the latest build to try out.
     
  33. hwise

    hwise

    Joined:
    Oct 27, 2012
    Posts:
    8
    oh that's really beautiful! i especially love the planets with mountain peaks! good job!
     
  34. HashbangGames

    HashbangGames

    Joined:
    May 7, 2011
    Posts:
    40
    Hey Darkcoder,

    Purchased your SGT toolkit the other day. It is quite amazing. Very useful, low overhead and is perfect for our game. We are making good use of most of the components in the SGT toolkit. One of them is the asteroid ring. We have made an asteroid field in which we fly a ship though. One thing I realized is that since all the asteroids are dynamically created, there is no way to interact with any of the asteroids of the ring. So when I shoot at one, my projectile flies through the asteroid. But what I really want to do is collide with it and blow it up! destroying the current card it hit and instantiating a particle effect of a asteroid blowing up.

    Code (csharp):
    1.  
    2. if (  Is currently possible to do? ) {  
    3.    please tell me how :)
    4. }else{
    5.    Can you add some way to interact with the asteroids?
    6. }
    7.  
    Thanks in advance,
    Marco G. Williams
    Hashbang Games
     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Right now it's very hard to check if an asteroid hit anything because the asteroid positions are calculated in the vertex shader and not stored in system memory. I can think of a way to optimize the asteroid generation to make finding an asteroid at a specific point more efficient, but I highly doubt I could use Unity's native collision system without a massive performance impact. I'll investigate this after I release version 1.1! Thanks for the feedback :)
     
  36. HashbangGames

    HashbangGames

    Joined:
    May 7, 2011
    Posts:
    40
    When do you expect you will release version 1.1? Also, have a look at how we are using your SGT Toolkit. The white line is the path our ship follows. This is an unfinished prototype, and only has a few of the enemy bases n such in there. But you get the idea.. Since there are so many asteroids, if you can shoot through them it would be kinda silly .. lol

     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    The programming for 1.1 is done. All that's left is the documentation and example scenes, they're about 25% done, so probably not that long.

    Your project looks really cool! Hopefully I can find an efficient solution to collision with asteroids.
     
  38. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Nice! This is music to my ears. I bought this entirely for all the awesome stuff you were showing in your preview posts.
     
  39. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Absolutely love this asset. Truly class.

    Here's an example I've been working on for a planet-landing prototype for a Star Control 2 like game.
    http://www.youtube.com/watch?v=1yDAcYC0TNo

    The atmospheric scattering is just the business, and the fact that out the box, you get the whole atmosphere / spec map / normal map and it all works on mobile... man. I feel like i'm in Santa's workshop or Magrathea.

    Kudos to @Darkcoder.

    Mike
    @runonthespot
     
  40. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Darkcoder,

    My loading time jumps from 15 seconds to 55 seconds even without using a single component or script from Space Graphics Toolkit. All I do is import it into my project and the loading time jumps majorly. My phone is a recent Nexus, so it's definitely not the hardware. If I do use something (the asteroids, for example) the performance is absolutely fine on mobile. Something must execute on start up even if nothing is being used by the toolkit.

    Could you please look into it? I can't use it in this state.

    Cheers!
     
  41. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    My guess would be the shaders, because there's almost 300 of them. If you delete the SpaceGraphicsToolkit/Required/Shaders directory, does the loading time go back to normal?

    I don't have an Android device so it's hard to test right now, but loading times are fine on my iPhone 3GS/4S, and my Android testers didn't seem to report anything like this (though I should have tested it across more devices I guess).
     
  42. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    Yes that was it. So the solution is to only have the shaders present that you're going to use? I didn't know they affected load times.
     
  43. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks for testing it, I also didn't know they affected loading times. I'm not too sure what I can do about this, maybe not loading UnityCG.cginc would speed up load times, but I don't think it would change by much. Ideally I would create an automated system that copies the required shaders to the /Resources directory, but because the components can be modified by code, it's impossible to know which combinations might be used during runtime. So I guess the only solution I can think of is for the users to manually move/remove the shaders they won't use. I hope I find a decent solution to this issue!
     
  44. EvilDingo

    EvilDingo

    Joined:
    May 7, 2011
    Posts:
    190
    It's much easier to just ignore mobile, but I'm really happy you haven't. Only adding the shaders I'm going to use fixed the issue entirely and it looks incredible on the device. Can't wait for the update!
     
  45. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    I was wondering, will the 1.1 update make it compatible with Unity 4 ?
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks! To help others, in the next build I'll write some documentation about how to identify which shaders are required for the build.


    Is it currently not compatible? In any case, yes 1.1 is compatible with Unity 4.
     
  47. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Hi Darkcoder,

    1.0 works with Unity 4.0 and is entirely functional but there are some strange behaviours that were not present in 3.5 so that is why I was inquiring. I am on OSX.

    Just in case, here they are :

    1)The first behaviour is that many of the shaders have warnings that were not present in 3.5 such as:

    Program "frag", error X4506: ps_4_0_level_9_3 input limit (8) exceeded, shader uses 9 inputs. (compiling for d3d11_9x) at line 28
    Program "frag", pow(f,e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them (compiling for d3d11_9x) at line 51
    Program "frag", pow(f,e) implicit truncation of vector type (compiling for d3d11_9x) at line 50

    Not sure if this has an impact on anything but I thought I'd let you know.

    2) I am having some errors that are related to the way the GUI is handled it seems. When I change a texture, the unity window that shows the textures for selection pops up and creates errors. This happens also when any window for selection appears. For example, if you want to select an observer for the starfield script this error will pop up or if you select a texture for the starfield it will create this error as well :

    ExitGUIException:Exception of type 'UnityEngine.ExitGUIException was thrown. Unity engine.GUIUtility.ExitGUI ()
    InvalidOperationException:Operation is not valid due to the current state of the object...

    Hope this is helpful !
     
    Last edited: Nov 12, 2012
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks for the info, I only briefly tested this with Unity 4, so I'll check it out in more depth tomorrow. Gotta love shader instruction limit warnings!

    [Edit] I've now fixed the GUI errors in Unity 4.

    The shader instruction issue seems to have been fixed by the new (4.0.0 f7) beta update.
     
    Last edited: Nov 13, 2012
  49. Django

    Django

    Joined:
    Nov 25, 2008
    Posts:
    120
    Thanks !

    I'm using f7. About the shader warnings its really strange. The warnings only show up in the inspector window after you select the shader in the project view.

    The warnings do not appear in the log until you right-click in the project view on a shader and select reimport on that shader. Reimporting it will then cause the warnings to appear in the log. However if the log is cleared then it wont appear again until you reimport that shader.

    To my knowledge, Unity 4f6 to 4f7 did not force the reimport of any asset that is why the warnings vanished from the log.

    The shaders seem to work fine so maybe the warnings are just harmless. In any case, if you could have another look just to make sure nothing is wrong that would be really appreciated.
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You're right, I didn't try reimporting them. Judging by the warnings It seems that Unity 4 also compiles the shaders For DirectX 11, which apparently have different compiler settings. So the shaders should still work on anything running OpenGL or DirectX 9.

    I hope the final version of Unity 4 will use a less zealous compiler setting, because fixing these is a bit annoying, and I'm not sure if I can fix the pow(f,e) warning without increasing the instruction count (on DX11 at least).