Making a galaxy look more realistic

So I have made a system which generates a galaxy. When far away, it’ll just place cloud billboards on positions for the arms. But it seems to spiral-ly and too unrealistic:

Here’s the code for making billboard positions:

        for (int i = 0; i < c_chunk.galaxy.armcount*2; i++) {
           
            c_x = 0;
            c_z = 0;
           
            c_rotation += c_chunk.galaxy.armcount/swirl_value;
           
            for (int j = 0; j < c_armlength; j++) {
               
                c_x += Mathf.Cos (c_rotation * Mathf.Deg2Rad) * (generator.generate_int(4,j)/7500) * 0.25f;
                c_z += Mathf.Sin (c_rotation * Mathf.Deg2Rad) * (generator.generate_int(4,j)/7500) * 0.25f;
               
                c_chunk.galaxy.arm_waypoints[i,j] = new Vector3 (c_x+x_offset,y_offset,c_z+z_offset);
               
                c_rotation += swirl_value;
               
            }
           
        }

I mean, it looks pretty good, but not quite like these 2:


What would I do to make it seem more realistic?

Try to use random particle effects on the arms. Place lighting in the middle and try to randomize as much as you can.

Thanks, but I am wondering how I would make it more cloud-like. If you take a look at mine, it’s just circle textures with blurred edges placed on billboards in a spiral. If you look at the other images, it looks more cloud-like, a bit misshapen and a bit blended in with the others, with coloured streaks. I want to know how I’d go about doing that.

http://articles.beltoforion.de/article.php?a=spiral_galaxy_renderer&hl=en

And I think if you want really reallistic don’t use any textures try to do it only with particle effects.
It might burn off your GTX Titan but will look gorgeous.

[EDIT] Here is another theory Making Galaxies - General and Gameplay Programming - Tutorials - GameDev.net

Thanks. I will have a look at it.

I don’t have a GTX Titan, so I worry how my GT740 will react…

I got sort of a deja vu now because I feel like I’ve made galaxies in Unity before. :stuck_out_tongue:

I think I based mine on this script:
http://wiki.unity3d.com/index.php?title=Particle_Spiral_Effect

I’ll check when I get home from work if I still have my project somewhere. It’s probably Unity 3.x and using the old particle system, but it could serve to get you started.

  • Foreground stars: use 5-15 ‘flare’ pre-made gray-scale textures (1 per size) and colorize them slightly so each star has its own hue.

  • Nebulae: Generate a random rectangular texture with perlin noise. The alpha must also be controlled by the perlin noise, so the image is transparent in some spots. Make them big and fade the borders, so they are seamless. Each nebulae must be colorized. Experiment putting very faint, big nebulae in the background, so the space isn’t completely black in all places.

  • Galaxies: Same as the nebulae, except that with much less alpha, and the border fading is less gradual and more “oval” in shape.

I don’t recommend pulsing. If you want to add some animation, simulate movement by adding different scroll levels (so the objects that are far away don’t move at all, but the ones near the camera move more)

Thank you for the reply. Although I am unsure what you mean for the galaxies.
Do you mean that I generate the shape with Perlin Noise or something else?

yes so its random.

I want a lot of my galaxies to be spiral galaxies…

It is so easy to make an elliptical galaxy using noise. Spiral is tricky, and I like the look of spiral galaxies.