Hi @montify , your pleanet looks beautiful! Very well done! I like the atmospheric scattering effect, it looks beautiful. Maybe a bit too bright at close surface. But nice, it brings the look of procedurally generated surfaces to another level.
No eye candy currently because I went away from the planet problem, probably until Unity3D 5.6 in March 2017 to investigate into the new Unity features, especially
Exposed Meshes and ComputeBuffers to native code plugins
GPU Instancing Improvements
- Procedural mode: supply instance data from a custom data source
- DrawMeshInstancedIndirect: supply draw arguments from a GPU resource
I have that feeling it has no sense to work on the planetary renderer currently while those extensions are still in the works. The Unity guys seem to heaviliy optimize Unity's render strategy currently, so I guess the wait is worth it.
Instead I went back to the very basic, very very basic structure of my application. It concerned me that my current procedural universe version created and placed planets simply based on Simplex Noise. Although I tried to keep 1:1 scale and reasonable distances between e.g. planets and suns, it wasnt realistic. Suns and planets pseudorandomly placed here and there.
Also I didnt like the way I streamed in objects, meaning how I instanciated and destroyed objects. Lastly I had the feeling there is still big room for design and performance improvement implementing the Scaled Space approach (originally from KSP) to render close and far away objects at once. Performance counts and is horribly important here, as I want to render a lot of visible objects, and I want to allow travvel from slow to extremly quicky (+1000x c). So objects needs to be referenced to often and very quickly. I organize the objects ins hastables and try to avoid any costly Unity call whereever possible (e.g. GetComponent). In favour for a new ScaledSpace approach I organize all my objects in the hastables and references, completely avoiding Unity's parenting hirarchy for the large celestial bodies. I hope this works out.
Also certain checks for extremly far away objects are now less often done than for close ones. All that stuff.
So I currently reorganize and redesign lots of stuff. My current approach for instanciating objects is that each object (e.g. a sun or a planet) has a specific "Controller"-class attached that, besides other stuff, can instanciate further objects via "Factory"-classes. Typically depending on the camera distance.
(not yet decided) -> creates Galaxy
Galaxy -> creates (not yet decided)
(not yet decided) -> creates SolarSystem
SolarSystem -> creates Sun
SolarSystem -> creates Planet(s)
Planet -> creates PlanetaryRing
Planet -> creates Moon(s)
AsteroidField -> creates Asteroid(s)
Asteroid -> creates AsteroidDust
This allows better LODing and keeping the need for resources low, the scene basically manages itself. If you are far away from a solarsystem, there is no sense in having a planet, nor a planet checking if it should render a moon. However I havent yet started profiling all the above.
Well besides the organization I implemented the SolarSystem controller which now places the sun and planets in a correct scale. Furthermore I added a lot of astronomical information to each object. The sun has a certain mass, luminocity, temperature etc. The planet has mass, orbital peroid based on Keplers law, temperature (based on physical calculations that consider the planet parameters, albedo, distance to sun, sun parameters etc.), habitability scoring etc. Some work went into seaching the web for any interesting physical / astronomic / mathematical constant I could gather in a single "GlobalConstants"-Class .
The sun has an adequate 1:1 scale and the planets are scaled and positioned in the orbit also realistically (technically, in Unity depending on the Space (LocalSpace, ScaledSpace etc.) to workaround the float problem). I've warned you, no eyecandy this time.
While checking how to place planets orbiting the sun I stumbled across the Titus Bode Law, which is a very interesting read. https://en.wikipedia.org/wiki/Titius%E2%80%93Bode_law
The formula is super super simple but helps to place planets right in a solarsystem similar to ours. There are lots of discussions about that formula that is not based on any physical law or cause, nonetheless it is quite acurate in our solarsystem and, interesting too, at further solarsystems which were analysed to disprove the theory.
While working on this you stumble about many questions fun thinking about.
- How small or large can a sun be (until it would end up to something else)?
- How small or large can a solid planet be?
- Are there "lonely" dark planets outside a solar system without an object they orbit (hopefully not, this does not fit to my instancing strategy )?
- Which planet types can have planetary rings?
- How are asteroid fields spreaded and organized? E.g. how could you handle the Kuiper Belt which is a small circumstellar disc surrounding the sun? I am right now thinking about a "AsteroidBelt" instance that regularly checks the radius and angle of the player position compared to the sun, and starts the instanciate asteroids when the player is within a certain threshhold. I guess the asteroid belt or the density of the asteroids within is not visible, as the area is still way to large, so there shouldnt be a need to render anything ring-like.
But well this is my planet stuff currently. Not even as beautiful as yours, only too much tl;dr and no screenies.