Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Space Technoloy & Visualization (VR)

Discussion in 'Works In Progress' started by Partel-Lang, Feb 19, 2015.

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    Hi!

    I'd like to share a hobby project that I'm working on when I'm not working on Final IK.
    It is about creating virtual technologies and visualization techniques for realistic space simulations and games.

    Space1.jpg
    Space2.jpg
    Space3.jpg

    Here is a rough list of what I have done so far:
    • High-res Earth model. Divided to 16 segments each with up to 4K textures for diffuse, clouds, night lights, normals and water alphas dynamically loaded/unloaded based on the camera position. Custom shaders for the planet surface and atmosphere
    • The simulation runs in m/kg/s units, so the universe is in 1:1 scale. That means 1 Unity unit = 1 meter, so the scale of the sphere that is the Earth is 1.27562e+07, that is the actual diameter of the planet.
    • Motion of the spacecraft is simulated by PhysX. Orbital velocity of spacecraft on Low Earth Orbit is 7000 - 8000 m/s (about 10 times faster than a bullet) and that is the actual velocity of the spaceship rigidbodies. With 1:1 scale of the universe, collisions between spacecraft and even ragdolls can easily be used.
    • Spacecraft attitude is controlled by an RCS (Reaction Control System) using real thrusters (AddForceAtPosition).
    • Component based spacecraft setup (thrusters requiring propellant and electricity, solar arrays refilling batteries and so on).
    • Calculation of all Keplerian elements, analysis and visualization of elliptical orbit.
    • Custom lens flare system for nice sunrises.
    • Oculus support
    Some of the stuff in the todo list:
    • Spacewalking with active ragdolls. Animation applied physically in muscle space. Imagine this with OVR and Razer controllers! :)
    • Calculation of hyperbolic/parabolic trajectories to fly to the moon.
    • AI for automatic orbital synchronization and rendezvous.
    • Aurora
    • UI controls for spacecraft, camera...
    What am I going to do with it when it is finished? I don't know yet, I'm just a space fanatic.
    Perhaps I'll upload it to the Store, perhaps I'll make a semi-realistic orbital warfare game. :)

    Oh and finally... here is a demo that you can try if you have an Oculus DK2 and Windows.
    You are flying next to an Apollo spacecraft somewhere on Middle Earth Orbit, on an equatorial orbit (180 degrees inclination). Press keyboard 1 - 9 for time scale and hold Space to see how the Apollo accelerates with it's main engine.

    Enjoy the sunrise! :)
    Pärtel
     
    FreakForFreedom and CWolf like this.
  2. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    ...and here's a video.
     
  3. TOBII_Rickard

    TOBII_Rickard

    Joined:
    Sep 15, 2014
    Posts:
    23
    Pretty awesome! Feels alot like kerbal space program :)
     
  4. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    Those green bastards.. maybe I'll make a human vs kerbal space war game instead :D

    Anyway, here's a video about some articulated ragdoll phsycs in space:
     
  5. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Wow amazing stuff, please do release.
     
    Partel-Lang likes this.
  6. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Yep. looks great.
     
    Partel-Lang likes this.
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,479
    haha, whoever was driving that module is gonna be in a world of hurt when they get back to earth. :D Looks awsome!
     
    Partel-Lang likes this.
  8. Raresh

    Raresh

    Joined:
    Feb 19, 2015
    Posts:
    7
    Outstanding work for someone who works alone
     
    Partel-Lang likes this.
  9. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,781
    Very beautiful.
    The one thing that was distracting and I didn't like was the lens flairs. Sorry - but the rest is very nice.
     
    Partel-Lang likes this.
  10. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    It looks good :)
    I saw that video presentation of KSP on Unite 2013 the other day. It was very interesting to see the approach they used to get rid of floating point errors due to the huge space distances. With the 1:1 scale that you use whats your experience so far?
     
  11. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    Its funny I had not seen that presentation, but arrived to pretty much the same conclusions. I guess there is really only one way of doing this. :) It's basically the same "Farnsworth" system, moving the universe around the ship. But instead of using 6000m thresholds, I keep the ship (or whatever is the focus) centered at all times. That's great for complex physics, I dont need to worry about floating point inaccuracies and can run ragdoll simulations smooth as ever. Objects that get too far from the focus switch over to double precision kinematic motion.

    Rendering is done with near and far cameras, that works great as well.
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    Managed to (finally) find a way to smooth out the Earth's horizon where the outline of the sphere connects with the atmosphere.

    It used to look like this:


    It was more or less OK, but the light conditions are very different based on the angle of the Sun and the camera so at some angles the edge was very noticeable and distracting.

    Now it looks like this:


    It was done basically by combining the "Crease Shading" image effect with the "Blur" image effect. From Crease I got the outline of the planet which I then used as a mask for blending between the source and the blurred image.

    Here's the full picture:
     
    theANMATOR2b and John-G like this.
  13. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,025
    Added some thrusters to the astronaut's backpack. It's a little bit like the SAFER system that they use to move around untethered in case of emergency although not nearly as accurate and smooth yet. It tries to maintain his rotation relative to the camera and also enables him to fly around in all directions.

    There is also a bit of Earth shading and light effects displayed in this video:
     
    LaneFox and LampRabbit like this.
  14. Ragoo

    Ragoo

    Joined:
    Feb 15, 2014
    Posts:
    75
    Alright, just hooked my DK2 up, ready to give this and your other stuff a whirl. ;-)

    Will provide feedback when done drooling.
     
    Partel-Lang likes this.
  15. educjunior

    educjunior

    Joined:
    Jun 3, 2015
    Posts:
    1
    Friend, can offer the project to open in unity?
    or make available to download the jetpack.
     
  16. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,667
    This looks really cool.
     
unityunity