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

Galaxy Map (Galaxy Generation)

Discussion in 'Works In Progress - Archive' started by Simeon, Jan 12, 2015.

Thread Status:
Not open for further replies.
  1. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    You can star particles by using the StarFinder class (There is an example project that use it). Star particles include information about their size, color, focal point, starting time, rotation and more. I've included 3 types of access to that data, like linear or random sampling of the stars. Alternatively you can just get all particles stored in the Particles component.
    As for your post processing, you will have to do that on your own. You will have to calculate distance from their position.
    The starting time of the particle is the angle in radians generated by the Density Wave distributor, you can use that to determine if the star is near an arm or just use it's color.
     
  2. Ravenshadow

    Ravenshadow

    Joined:
    May 16, 2013
    Posts:
    11
    thanks for the info. I'll give that a try.
     
  3. MachoBrizzin

    MachoBrizzin

    Joined:
    Jul 10, 2013
    Posts:
    27
    This looks fantastic. I'll be sure to pick this up when I can. Great job!
     
  4. Jacob-Williams

    Jacob-Williams

    Joined:
    Jan 30, 2009
    Posts:
    267
    @Simeon - I bought the asset a while back, and am just getting the chance to dive in. First of all, I love the work and it does almost everything I need out of the box. The one feature I would love to see is more accurate rotation. I don't want to rotate the whole object, but have more realistic movement to the stars. Here is a quick video of what I'm looking for. Is this something that will make it into a future update?

     
  5. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Yes that feature is inherent in the Density Wave theory algorithm used to distribute the stars. I had this feature but it was quite costly. Costly enough that it could only be done on the GPU. That meant that getting useful information about the stars was quite difficult and unpractical. I could include an API call to rotate the galaxy but It probably won't work for realtime animations, or at least it would run with 3 fps.

    You can actually animate the galaxy right now, by changing the "time" variable in the ProcessContext passed into the DensityWaveDistributor class.
     
    Last edited: Jun 28, 2016
  6. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I just added Animation support. I event made an example scene. It should be in version 0.34
     
  7. Jacob-Williams

    Jacob-Williams

    Joined:
    Jan 30, 2009
    Posts:
    267
    Thanks for the quick support Simeon!
     
  8. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Hi Simeon,

    Would your asset work on mobile phones if the particle count is set to a lower value like 10000?

    Great asset by the way!

    Raydekk
     
  9. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    It should. It uses unity's particles, as for the GPU particles if the mobile platform supports them even higher particle amounts should work fine.
     
  10. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    100
    Great!
    Is it possible to modify the galaxy generation to create custom galaxies? Like adding a 'rogue' arm (shaped like an arc) like the Orion Arm between two spiral arms, but still keeping the density wave effect?
     
  11. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    You could write an entirely custom star distribution. Unfortunately the density wave function I've included only works with 2 spiral arms. You could possibly combine 2 galaxies, or use an Image mask as a distributor for all kinds of shapes.
     
  12. DeCarvalho

    DeCarvalho

    Joined:
    Mar 16, 2014
    Posts:
    5
    Why is it dead? :O
     
    Akotta likes this.
Thread Status:
Not open for further replies.