- Home /
How do I find the horizon?
I have a dynamically generated terrain, and I need to find the region of the screen that is sky (above all of my objects) or the line separating the objects from the sky. Is there a way to do this other than to check every screen pixel to see if its color matches the sky color (obviously impractical)? I have been looking for an answer for a few hours now and have come up with nothing useful, so any help would be greatly appreciated. Thanks in advance! :)
What are you attempting to accomplish by doing this? In what form do you expect to have this data? What will you do with it?
Checking every pixel for sky color is a non-starter, I'm afraid. Depending on what you hope to ultimately accomplish, maybe there are other ways of approaching it.
The reason I asked about this in the first place was because I was getting a large Garbage Collection Allocation in the Unity profiler. Long story short I thought the cause could be fixed through finding the horizon line, but the cause was actually something else entirely. Thank you for your answer, and I'm sorry for wasting your time on this one.
Your answer
Follow this Question
Related Questions
Best way to make an unlit Cg shader 2 Answers
Skybox uses 1.7k Tris and 5.0k Verts even if occluded? 1 Answer
Is there a video tutorial to making seamless skyboxes? 1 Answer
Sky all around sykbox 0 Answers