- Home /
Rendering "long exposure" star trails in the sky
Basically, I'm trying to reproduce a timelapse image of the stars rotating, like this image.
Right now, I have a separate "skybox camera" that sits inside a sphere mesh. The sphere faces inward to the skybox camera and has a starry texture applied. It can be rotated, thus giving the appearance of the stars rotating.
Now, I need to find a way to get those traced lines as the stars rotate. The effect can be cheesed/faked by setting the camera to "don't clear", but that would also mean that I would have to fix the player in place so they don't mess up the rotation. It's also potentially buggy.
The only other thing that would come to mind is duplicating the sphere mesh with the stars and offsetting the rotation multiple of each duplication, something like "onion skinning" the star-sphere. But that would quickly increase polycount, and may not be a perfect visual result.
Does anyone know an image effect or shader to get a 'long exposure' effect like this? Or a stable way to reproduce the trails left by a camera set to 'don't clear'?
Thank you!
Anxious to hear the suggestions for this one. If it's spinning kinda fast your idea of having multiple spheres will work. It won't be noticeable to the naked eye, just have the rest deactivated and activate them one by one. No one will notice and the trail will slowly begin to get bigger. Which also leads me to another idea. If you make it spin real fast there's a good chance it'll look like a trail. I once spun my scene around real fast and got some crazy results that might be what you're looking for.
if you don't clear they will become a solid line on the first rotation, and you won't notice the second rotation anymore or the thousands that may come after. For it to be discernible you would need to slowly move either the sphere or the camera so that the rotations don't match and the stars begin to leave a new trail. It will become a mess after a while though, unless the lines are really thin.
Depending on how many stars you have, this might not be practical, but for each star you could create a line renderer or trail renderer adds small segments in a trail as the sphere rotates. If you made it with a low-opacity material, lines would get more distinct the more times a star passed over them. I can elaborate in a full answer if the idea is intriguing and/or unclear.
Thanks for the ideas! I should clarify that I don't plan for the trail to get TOO long. About as long as the linked image. This will also happen pretty slowly.
I will also be working with actual star data in the final iteration, so that means a lot of stars. Because of this, I thought it may be best to avoid line renderers or particle systems… but maybe I should just test it. Getting that working with proper star data will be pretty difficult, however!
Answer by supericecream · Sep 02, 2014 at 10:31 PM
Use a line renderer as ozone said, or
Use a trail renderer, or
Use a particle system that produce none moving particles (use the same texture as your star, also make sure they die with the correct time, or you will have just circles in your sky)
Use some magical method that I'm not aware of as of yet
Sorry for the delayed response.
For the current build, I am just locking the camera in place and making use of the camera's "Don't Clear" setting to leave a trail in the sky.
I think I will move on to some particle/trail renderer combo in a future build (or maybe just create a large number of particles to display the trail as you suggest).
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613162107im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Edge Detection script [Legacy Image Effect] - NOT working on mobile (iOS, Android) 0 Answers
What is the best way to make clouds with png images? 1 Answer
Image effect or shader that renders alpha? 0 Answers
How to set a texture in an image effect material? 1 Answer
Why is skybox pink in build only? 1 Answer