Yesterday I created a marginally adequate star generator to populate my galaxy with stars. The method I chose for this was to make a prefab and instantiate it for every star. In other words, every star is a billboard and its own gameobject.
This was apparently a mistake on my part, because:
- I could create only around 4000 stars before the frame rate started lagging.
- And, when I tried to animate each star with a twinkle effect (via changing color.a), the framerate dropped horrendously to about 1-5 fps. this effect was as a script attached to each gameobject.
Then last night NCarter on IRC said I should render all of the stars as a particle array of a particleEmitter. I have tried to do this rather unsuccessfully by building a generic list of stars (and their data as a class) and iterating over the list to build an array of particles. No errors occur, but no stars render either.
Can anyone tell me how to create particles via script, or point me somewhere that does?