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

Sci-Fi Graphics Toolkit

Discussion in 'Works In Progress - Archive' started by Darkcoder, Jun 15, 2012.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Most of the games I make take place in space, as such, I've learned a lot about how to achieve a wide variety of graphical effects. This package will allow you easily create your own awesome sci-fi scenes with very little overhead!

    Feature Overview

    • Supports iPhone (and probably Android, but I don't have one)
    • Supports Unity free
    • Alter everything in realtime (via inspector or C#)
    • Stars
    • Planets
    • Planetary Rings
    • Asteroid Belts
    • Starfields


    Planned Features

    • Black Holes
    • Speed Streaks/Dust/Debris
    • Planetary Clouds
    • Animated starfield colours


    Stars

    - Set the atmosphere thickness
    - Set the atmosphere opacity falloff
    - Set the atmospheric colour at a specific density
    - Set as many density colours as you want
    - Seamlessly fly from space to the star's surface




    Planets

    - Includes all features Stars have
    - You can turn off the atmosphere if you want an atmosphere-less planet/moon
    - Apply a texture to the night side (street lights, glowing lava, etc)
    - Set a colour between the night and day region (terminator) e.g. red sky



    Planetary Rings

    - Set the size and thickness of the ring
    - Stretch or Tile a texture around the ring
    - Allow a planet/moon to cast a soft-shadow on the ring
    - Set the penumbra (soft-shadow) thickness and colour




    Asteroid Belts

    - Includes all features Planetary Rings have
    - Very efficient billboard asteroids (10,000+ with little overhead)
    - Change the distribution pattern (e.g. more on the inside/middle/etc)
    - Animated orbits, each asteroid has a different speed etc
    - Set the inner+outer orbit speed
    - Have any number of asteroid texture variations




    Starfields

    - Set the amount/distribution/size/etc
    - Very high resolution, as each star uses a unique billboard
    - Use the starfield as a background, or a foreground item
    - Set the pulse rate/amount
    - Have any number of star texture variations




    Misc

    - Basic orbit script for planets/moons
    - Skysphere script
    - Alien star system scene
    - Solar system scene






    -------------------------------------------------------------------------

    If you have any questions or feature requests, then let me know!
     
    Last edited: Jul 4, 2012
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    Yeah - How do we get this cool package?
     
  3. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I'll release it on the asset store sometime soon. But I still need to polish up a few things, write documentation, etc.
     
  4. kellygravelyn

    kellygravelyn

    Joined:
    Jan 22, 2009
    Posts:
    143
    Looks really great! I'd love to make a space exploration game for iOS and these would be great. I probably wouldn't need the "fly to surface" or some of the other features, but it probably wouldn't hurt to have the options. :)
     
  5. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I've spent the past few days fighting with the Unity GUI to get my inspectors to look good. It's a shame not all of the useful features are exposed in the API, but I got pretty close to what I wanted without having to rewrite everything!

    Here's a picture of the planet inspector and my gradient editor:



    As you can see, there are only a few things you need to tweak to get vastly different planets, and it should be fairly obvious what most of the options do. The rest is handled behind the scenes, so you don't have to worry about materials, shaders, etc.
     
  6. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    A-ma-zing :O

    Congratulations on this one. Maybe I can help if you want to expand the feature list ;)
    I like the main parameters that you have set, now I see that we can have asteroid belts around a star, is that right?

    Also, I see that there is a basic orbit script for moons, can stars have an orbit? If so, can stars be moons? (Like binary or multiple star systems)

    And about starfields, can we travel among the stars? If so, I suggest to include a new amount/distribution/size pattern, with galaxy shape.

    Please let me know if you need any kind of support ;)
    You made an excellent work, I see lots of uses for this :)
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I hope so! I'm struggling to think of things to add (that won't take me ages!).


    Yes, you can have asteroid belts or rings around anything. In fact, the rings don't have to be planetary rings at all, you could use them to mark a planet's orbit for example.


    Yes, anything can orbit anything, and stars can be anywhere. But each planet/ring/belt/etc can only have one light source. I could maybe allow for multiple light sources, but it's not that straightforward to do, and it would slow down the shaders quite a lot.


    Yes, you can travel to the stars, but they're just billboards, so they don't look as good as the actual star objects up close. I was really considering adding a galaxy distribution to the starfield script, but I didn't get around to it. I'll add it to the list!


    Do you use Unity? If so, you could help test the package!


    Also, planets can now have clouds! This Earth uses rather high resolution NASA images that I won't be packaging with this.

     
  8. Jolon

    Jolon

    Joined:
    Jan 22, 2009
    Posts:
    31
    This looks absolutely incredible! Let me know if you would like help testing.
     
  9. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    That looks great! Now you just have to improve the space area.
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    When staring at the same thing all day it's hard to notice issues. What stands out the most? Ref pics would be awesome too!
     
  11. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    I understand about the light sources. Good to know anyway ;)

    Well, definitively tou gave me the final reason to get into!
    I have no experience with Unity so far, so maybe I cannot see full potential at 1st sight, but this is worthy enough to install it and find it out!
    I will be able to give you more feedback once I see how it works.
    Otherwise I might be suggesting things that already can be done with the engine like, for example, adding space stations that orbit around the planets? Or maybe sharing orbit with an asteroid belt? Or free-floating? Or perhaps some other kinf of 'free orbit' objects... We'll see ;)

    Dunno, have to see the missing things that could be closer to the current development status ;) And also, understand how far is your scope for this one.

    Clouds were a must;)
    The texture source is an interesting point. I'd like to test this one with a bunch of textures that I have around, and see the different kind of textures that can be feed. Did I see normal maps?

    Oh well, you count with me on this one, yaw!
     
  12. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Other than that, stars could be always improved, I think you already know about these kind of features, so feel free to check as ok/pending/discarded, don't know which ones are already included:

    - Star oblateness parameter
    - Star particle system
    - Star surface sunspot parameter
    - Star surface pulse parameter
    - Star surface oscillation parameter
    - Lens flare (Silly on my side?)
    - Additional kind of objects, at least for space background, like nebulae, star clusters and galaxies.

    One silly question about planets, they have night lights, right?

    And, can we set the eccentricity/inclination/bearing of the orbits?

    It should be easy to include some planet variation in appearance based on the distance to the parent star, you know. Oh well, maybe not a big deal. You decide.

    Also, I would like to know if we can place objects over a planet surface, like buildings, landing pads, or even terrains etc. how far can we go this way? Does that make sense?

    By the way, Unity installed and running. Docs readed. Awesome, as you told me ;)
     
  13. Patapouffe

    Patapouffe

    Joined:
    Apr 3, 2010
    Posts:
    88
    Hi,

    this looks great ! If you need someone to test it let me know, I'll be happy to help.
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Well, my orbit script is really basic, you basically attach it to any object and set the orbital period. I designed it like this because if I have many orbit parameters I can't really derive the orbit values from the object's current position, and I'd rather not move the object when you attach the script. I'm pretty sure there's a far more comprehensive orbit script on the WIP boards somewhere.


    I'm still not sure how far I'll develop it, it really depends on the amount of interest (i.e. sales) I get from it, but I hope to pretty much cover everything space-related... eventually!


    Not yet, but I'll eventually get round to it!


    I haven't added in oblateness to the planets or stars yet, but it should be pretty easy. I think I've found a way more efficient way to handle this compared to my previous attempts!


    What kind? Unity already comes with an awesome particle engine, but I may eventually add arcing solar flares that appear on the surface.


    I still can't think of a decent way to handle these :p


    Can you explain what these would do?


    Unity already comes with a lens flare feature, and in the Unity store there's an awesome free lens flare pack!

    Easier said than done! Star clusters are easy enough, but nebulae and galaxies are very hard to do well. I've seen many realtime and rendered attempts at them, but they never quite look convincing enough for my liking.


    Yep, here's the back of Earth:




    Nope, maybe this could be your first Unity script? :)


    Right now no, the illumination colour is set by the user. But if the distance between your planet and its star doesn't vary by much, then you can just set the colour tint when you're creating the planet.


    Kind of. Of course you can place stuff on the surface, but if you want it to be visually affected by the atmosphere then it would probably have to use the same shader the planet's surface uses (or at least one similar). For smaller objects I could write a function to retrieve the colour and opacity of the atmosphere at a specific point, you could then give your object that colour. But that would also require a custom shader.


    ------------------------------------

    As for the testing, I'm not really sure how I'll handle it. But I think I'll just make a private board on reddit and invite you guys, that way it's really easy for me to manage everything and you won't repeat what another tester has said. Would everyone be fine with using reddit?
     
  15. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Oh well, this falls out of my comprehension at the moment. I'll try to understand gradually.

    Hey that's good news, I hope you catch a great success here.

    You know, that should be crucial to make some terrain worlds, shouldn't it?

    Maybe it isn't that obvious for planets, but oblateness would add variety to stars. Think about it.

    Yeah, something neat and fancy, but I haven't checked Unity particles yet, so this might be out of place as you said.

    Maybe just amount and/or period. I have to take a closer look to your star surface and we can talk about this again ;)
    [EDIT: I mean intensity, not an exact amount of spots]

    About the star surface parameters, pulse parameters would be to make the star size grown and shrink, they could be amount (how much it grows) and time period (how much time between the same size)
    The star surface oscillation parameter could deform the star sphere to be irregular and/or have waves. It could be just 'intensity', deviating from a perfect sphere.

    Yes I was expecting that kind of things, nice to know!

    I undestand. We'll see what we can do. As said, I have to take a closer look, maybe your background is good enough already.

    Hehe, it might! ;)

    I think that could be extremely interesting. Being able to interact with planet surface objects would multiply the possibilities of use. Of course I might be thinking about... landing a spaceship at some point? :D

    About the testings, if you recommend reddit, it should be fine here ;)
     
    Last edited: Jun 22, 2012
  16. Patapouffe

    Patapouffe

    Joined:
    Apr 3, 2010
    Posts:
    88
    Sounds good to me !
     
  17. jamieo01

    jamieo01

    Joined:
    Nov 24, 2009
    Posts:
    68
    Do you have any idea for a price yet?
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I'll see if I can create the reddit board, it just got automatically banned and I'm not sure if the mods will even read my appeal :p


    I haven't decided yet, it really depends on how much content I put into the initial release. But right now I'm thinking $50, thoughts?


    ----------------------------

    If anyone wants to test this pack, could you PM me with the following details: Amount of Unity experience (maybe links to projects), and PC specs.
     
    Last edited: Jun 22, 2012
  19. kellygravelyn

    kellygravelyn

    Joined:
    Jan 22, 2009
    Posts:
    143
    $50 seems pretty fair for what you've shown here. You mentioned you can fly from space to surface; do you have any more details, screenshots, or videos of that?
     
  20. Dzipi

    Dzipi

    Joined:
    Mar 27, 2012
    Posts:
    3
    Generating planetary systems and space objects in general is something I am looking for, for my next long term project.
    If you need someone to try your stuff out and maybe contribute in future (once my current non-unity mobile app is done) count me in!
    I just run into this thread, I'll take some time later tonight to really read through, but stuff you are doing is really very interesting to me.

    Oh and I am a newcomer to Unity so I'll need some time to ramp up :)
     
  21. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Can't find a reference picture right now, way to busy, but it just seems a little plain to me. Maybe add a little life in there... (I know that's vague, so I'll look for a picture if I can).
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sure, I just made a video:

    http://youtu.be/LQUGNGBA3qA

    And here are some pics of it:



    I'm in the middle of updating the planet shaders to use the same code as the stars (for the atmosphere), so I didn't show them off. But it's basically the same. I'll later make a video showing off the planet atmospheres in more detail, along with a more interesting surface mesh! :p


    Sure, when you want to test just PM me with your PC specs and I'll give you a build!


    I'm not really sure how interesting space looks from this solar system, but I changed the skysphere to show the milky way's dust clouds, and I tweaked the starfield to be more interesting, is this better?

     
  23. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I've updated the planet shaders. You can now have planets that aren't complete spheres! Here's a pic of an extremely exaggerated Earth:



    The mesh was generated using a simple script that takes a mesh and a heightmap.
     
  24. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Looking good :)
    Glad to see that you moved into planet surface treatment. Nice idea.
    They look a bit spore-like but I guess it is just a 1st version, or that it can be tuned to produce less 'toony' planets. Did I see single colours or we can still use textures?
    Also, do you plan to have some kind of LOD system when approaching?
    About the star surface, I still find it somewhat simple at the last video. Please let me know if you want to try to migrate our MPL3D star surface shader.
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I deliberately made the atmosphere and terrain height very high, because if I made it realistic then it would still look like a perfect sphere.


    I could implement a simple LOD system, but don't expect to be able to fly down to the surface and see highly detailed mountains on a 1:1 scale planet. There's already a Unity package for that, and it's simply too much work.


    Of course! I removed the planet's texture so you can easily see the atmosphere filling up the areas with low altitude.


    I don't remember what your star surface shader did :p But I'll probably study some sunspot videos and come up with something.
     
  26. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Ooook, I understand ;)

    Yes indeed, I understand as well. Don't worry, I was just asking.

    Alright, but can textures be applied then?

    Ok, check me before you start if you want ;)
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Yep, I made a few more pics with full textures below.


    Will do!

    --------------------------

    Update: I've implemented atmospheric scattering! You can optionally enable this on your planets.

     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I just made a video showing off the new planet shaders:



    You can now apply a normal map to the surface. Once I add specular highlights, this pack should be pretty much ready for release.
     
  29. Ajjar

    Ajjar

    Joined:
    May 26, 2012
    Posts:
    32
    I would very much be interested in your kit sir. :) Looks amazing by the way.
     
  30. sherlockturtle

    sherlockturtle

    Joined:
    Jan 23, 2012
    Posts:
    592
    How much will it cost?
     
  31. jamieo01

    jamieo01

    Joined:
    Nov 24, 2009
    Posts:
    68
    He said in a previous post.
     
  32. skine

    skine

    Joined:
    Jul 3, 2012
    Posts:
    12
    Looks amazing! Any chance I could get an invite on the testing? Would love to test this out!!
     
  33. Aocou

    Aocou

    Joined:
    Jul 8, 2012
    Posts:
    2
    cool, release date? I have just implemented a solar orbit transfer and Kepler's laws in Unity, now just want some good looking solar planets.
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    If you have an Android device that can run Shader Model 2.0, then yes. But otherwise there isn't that much left to test.


    Hopefully within a week.

    --------------------------

    Yesterday I implemented specular maps. I won't release it just yet though, as I noticed that not including oblate gas-giants and stars would be a bit of an oversight, so I'll spend a while figuring out a decent way to implement them.

    For now, here's a pic of Earth with specular maps along with all the other features for planets:

     
  35. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    In case anyone's bored of seeing Earth all the time, today I implemented particle scattering through planetary rings, and the ability for planetary rings to cast shadows onto planet surfaces and atmospheres. What does this mean? It means you can now render Saturn fairly accurately:

    Screenshot from this pack:


    For reference, this is a picture of Saturn taken by the Cassini–Huygens probe:


    The Sun shining through Saturn's rings:


    Note: I haven't written the gas giant shader yet, so this Saturn still has no oblateness (though it may appear to, due to the aspect ratio).
     
  36. Aocou

    Aocou

    Joined:
    Jul 8, 2012
    Posts:
    2
    cool, hopefully I can get them within a week :)
     
  37. Padman_Silversoft

    Padman_Silversoft

    Joined:
    Jul 19, 2012
    Posts:
    8
    This is an awsome work. Bravo !
     
  38. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Nasa use Unity. They gonna love your pack ;)
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks for the nice comments! It seems that when I said I'd release in 1 week, I was operating under valve time. But I've since made a lot of progress.

    I've completed the Gas Giant script+shaders, these allow you to create oblate gas giants that can be flown into. Here are some pics of solar system bodies:

    Neptune - Notice the limb darkening (green tint at the edges)


    My favourite: Uranus - Notice the blue/green intensifies near the terminator (day/night transition point)


    Jupiter - Notice the moon's shadow in the bottom left


    Venus - Notice the clouds darken towards the edges, you can also fly through the clouds to see the orange surface


    Mars - Yay Mars


    Solar System - All Planets are to scale, except the distances obviously aren't (and I don't think the asteroid belt contains anything bigger than Mercury)


    [edit] I also created a corona script + shaders. These allow you to make slightly more interesting stars, and it's not just a billboard that faces the camera (though you have that option as well); you can actually fly around the star and it will look different, but it's not animated. Here's a pic of a very bumpy and oblate alien star:


    Anyway, this pack is 95% done, one more thing I need is a good name for it, I was thinking:

    Space Graphics Toolkit
    Universe Toolkit

    Thoughts/suggestions?
     
    Last edited: Jul 19, 2012
  40. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Space Graphics Toolkit sounds like the indicated. SGT looks cool too :)

    Hey man, this pack looks awesome! Thinking on using it to make nice backgrounds for a game. Do you think it would be have an acceptable performance hit for just backgrounds?

    Question: do you have in mind a mobile compatible edition? Edit: I see on your first post that this toolkit was intended to be mobile compatible, were you able to test it?

    And finally, If you could include a simple implementation of a 3D skybox/background, as seen in games as GSB or AIWars, that would be the corollarium :)
     
    Last edited: Jul 19, 2012
  41. Padman_Silversoft

    Padman_Silversoft

    Joined:
    Jul 19, 2012
    Posts:
    8
    Space Graphics Toolkit sounds good. :)

    I will buy this toolkit. I need it !
     
  42. nockieboy

    nockieboy

    Joined:
    Jul 7, 2012
    Posts:
    48
    Sorry, just want to clarify a couple of points:

    1) Will you be able to fly to the 'surface' of these planets? (obviously not the gas giants.)

    2) Are you just working on the planets in our solar system, or will it be easy to create alien worlds (esp. without having to create huge textures)?

    3) Anything procedural going on, in other words?

    Fantastic work so far - looking great and very difficult to separate your screenshots from the real thing!
     
  43. Padman_Silversoft

    Padman_Silversoft

    Joined:
    Jul 19, 2012
    Posts:
    8
    What do you mean by "fly to the surface" ?

    This is just a (awesome) graphic toolkit. So you have to develop your camera script to "fly" on planets. But the graphic part for the atmospheric scattering effect and other planet shader are already done (Watch the work in progress videos).

    For your second question you can watch the videos... You can apply some other textures on planets to do your own.

    Maybe I'm wrong but Darkcoder will validate (or not) my words.

    (By the way I'm french so sorry if my english is bad lol)
     
  44. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    OK, Space Graphics Toolkit it is :)

    It should be fine, if you're planning to use it for mobiles then the main concern would be the fillrate hit, because adding an atmosphere would double the amount of pixels drawn, I'll do some testing on my 4S soon.


    I'm glad you suggested this. I tried making a scene with planets and stuff in the background and found several issues/limitations with the pack, but these have now been fixed :) I'll be sure to include examples like this.


    I've tested an earlier build on my iPhone 4S, and I'll test the current build soon. I'll test it on Android soon as well, but I'd imagine it's the same. All shaders use Shader Model 2.0, so it should be compatible across all platforms, and most devices supported by Unity.


    Yes, you can seamlessly travel from space to the surface of the planet. But keep in mind this isn't a 1:1 planet simulator, so the amount of detail on the planet's surface depends on your planet mesh and planet texture. If you want a planet that increases in detail as you approach the surface, then you may want to find another product, unless you're willing to wait a long time until I may or may not add this.


    It's easy to create alien atmospheres, but you will have to make the surface textures yourself. In the OP I posted a picture of an alien solar system, all of the planet textures there are derived from cgtextures.com photos. If you want a purely procedural texture, then I'm sure there exists very good software to produce them. But it's a pretty large task to write such a generator, and getting good results would be very difficult and time consuming. For now, I'm focusing on bodies in the solar system because NASA provides a lot of very nice and free to use textures. Plus, it's a nice challenge trying to get visually similar results, if I just showed off alien worlds then there would be little basis to claim that it looked wrong.


    Not really, the starfield star placement is procedural, as are the asteroid placements/orbit speeds/etc.
     
    Last edited: Jul 20, 2012
  45. Novack

    Novack

    Joined:
    Oct 28, 2009
    Posts:
    844
    Excellent, thanks very much for the dedicated answers!
     
  46. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    Nice final touch to the stars, I like these kind of improvements.

    'Space Graphics Toolkit' sounds fine to me, short and cool. Although it doesn't describe all the job that has been focused on the planets.
    Anyway, looking awesome ;)
     
  47. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Solar System Toolkit would be appropriate too :)
     
  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks!


    But that would imply it can only make things within the solar system ;)


    Either way, I've renamed my classes and such, so Space Graphics Toolkit isn't changing!

    As for news: I've finished almost everything for the first release, I've just got to do some more testing on mobile platforms before I release it :)
     
  49. MPL3D

    MPL3D

    Joined:
    Jun 21, 2012
    Posts:
    9
    I've got an android, Samsung Galaxy SII, if it applies.
     
  50. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    You didn't you tell me sooner? :p I'll send you an apk after I finish iOS testing.