Draw distances are broken

DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Draw distances are broken

Post by DraQ »

Currently the game pretty much doesn't draw other planets in the system you're in (even when they should be clearly visible - for example here on Earth Venus is the third brightest object in the sky and Jupiter isn't far behind, Mars is also clearly visible and so on) and often fails to draw distant stellar objects, especially faint or compact (brown dwarfs and white dwarfs) even if they contribute to the lighting of the scene.

Being unresolveable is a poor metric of when to stop drawing a distant light source - if it was any good, we wouldn't see any stars at night IRL.
Previously used method that drew small star billboards worked pretty well, so I don't know why it was ditched, especially given that bright objects like stars don't really look bright when looked at any more (they would need some coronae - visual effect, not astronomical phenomenon - to actually look blinding), even from the distance when the little star graphic helped. The star graphic was also dependent on lighting colour while current dots are not.

Additionally the game doesn't ship to draw ships beyond relatively close range, or indicate their positions with billboards despite it being fairly realistic expectation with the amount of light they tend to reflect and engine flares (do note that ISS is clearly visible from earth's surface).

Finally, rendering of large, human-made objects is off - cities just pop into view at 100km (they are already large enough to barely resolve single buildings at this point) and I can imagine all sorts of cool things (like orbital elevators or skyshafts) that wouldn't work with current setup.

Are there any plans to fix that and why were those little stars dropped anyway?
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Draw distances are broken

Post by FluffyFreak »

The game does draw point stars, I put them back in after lots and lots and lots of complaints... you can't tell apparently but hey what would I know about it :/

The reason stuff doesn't get drawn is simply because there's too much stuff to draw. Drawing the cities is especially painful.
It used to be that we'd draw ALL of the cities on every visible planet, that was INSANE, I'm the one who limited it but perhaps I went a bit over the top.

Ideally we'd draw a city to a number of billboards or something then we wouldn't need to render all of the building and light individually however we don't have the facility to do that at the moment so the best we can do is stop drawing them... otherwise the framerate plummets.
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: Draw distances are broken

Post by DraQ »

I don't mean stars as in "starfield".

I mean stars in the system you're currently in.
Old versions drew objects too distant to be rendered normally as tiny, 4-pointed stars that were, IIRC colored using the color of light they emitted or reflected.

Currently Pioneer only draws rather nondescript fuzzy blobs, colored for light emiting objects, white otherwise (regardless of what color of light they are illuminated with) for a short time before ceasing drawing them altogether.

This is an obvious and severe visual downgrade even compared to original Frontier (where distant objects were drawn and colored in accordance with lighting) and it's just baffling.
I don't really see how drawing a couple of billboards can make an impact on performance, especially given that Pioneer didn't run slower back then.
It's even worse with stars in multiple systems which can contribute to the lighting of the scene without actually being drawn by the game (if they are small and/or distant) which looks stupid and ugly.

I'm under impression that it was done as misguided attempt at optimization and culling objects that are not visible, the problem is that if our objects are light sources surrounded by dark background, then whether they are larger than one pixel or (for RL analogy) large enough to be resolved by human eye is an extremely poor criterion for determining visibility - if it were otherwise you would not be able to see any stars (other than Sol), ever, IN REAL LIFE, which obviously isn't the case.

As a rule of a thumb, all planets up to and including Uranus should be drawn in Pioneer when viewed from Earth while Neptune, Pluto and planetary satelites (excluding Moon and Jupiter's Galilean Moons) should not.
Also, I think it's safe to assume that all light emitting objects in given system (stars including white dwarfs, brown dwarfs) should be visible regardless of distance, although drawn as billboards if too small to be resolved visually.

As for man made objects, cities should get their billboard graphics and/or reduced LOD meshes to let them be seen from orbit and stop them from suddenly popping into view - currently it looks awful and impairs orientation when trying to find places from orbit.
Stations should also be visible from quite a distance away - ISS is visible from earth IRL and Pioneer's stations are much bigger, while spaceships should be drawn (again, possibly as billboards representing faint glint of light) from hundreds, maybe thousands km away, engine flares should definitely be represented this way too.

Bright, light emiting objects should have billboard graphics or separate glow effect conveying that they are bright, current fuzzy dot just doesn't really convey that, even though if you were on a planet orbiting a good distance from, say, B class star, it would probably be too small to resolve visually, but looking at it would probably still physically hurt.

I also think Pioneer direly needs lighting dependant on distance from the source (maybe use some sort of logarithmic scale to help convey the possible illumination range? Some sort of HDR would help too) which it currently lacks, as well as local lighting for stuff like weapon fire, explosions, engines and city lights.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Draw distances are broken

Post by FluffyFreak »

Ok I see what you mean.

Regarding the billboards for Cities/Stations/etc, as well all of the other suggestions, most of these are - and have been - on our todo lists for years.

I'm not sure why some things take so long to get done but it's burnt several of us out trying to keep up with peoples demands.
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: Draw distances are broken

Post by DraQ »

But why was it changed from something that worked?

Wouldn't it be possible to revert that particular change?
impaktor
Posts: 995
Joined: Fri Dec 20, 2013 9:54 am
Location: Tellus
Contact:

Re: Draw distances are broken

Post by impaktor »

Related, for reference: #2791
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: Draw distances are broken

Post by DraQ »

impaktor wrote:Related, for reference: #2791
The problem isn't limited to Moon, though.
Venus should be clearly visible from Earth. So should Jupiter.
Mars, Mercury and Saturn should be perfectly noticeable as well, while Uranus should be visible just barely.

I think the culprit is somewhere there (because that's the code that got rid of spikies): https://github.com/pioneerspacesim/pioneer/pull/2714
and since it broke stuff without really helping anything, it should be reverted.

Spacecraft should be visible as points of light from around 1000km if not further (we're talking about usually bright, brightly lit object against near completely black backdrop) and that's without accounting for bright engine flares, which would be very helpful in combat - I think spikies could be adopted for man-made objects as well, just at less extreme ranges.
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Draw distances are broken

Post by FluffyFreak »

Keep issues separate, the rendering of ships etc aren't the same as the rendering of planets or stars or gas giants.
We're not reverting that change, it contains a lot of good changes! We can however fix problems with it.

You're saying that you want spikes back in place of billboards for for Stars. Or that you just want them visible again, because they should be visible and when they're not that is a bug we can fix.
DraQ
Posts: 149
Joined: Sun Mar 23, 2014 10:02 pm

Re: Draw distances are broken

Post by DraQ »

FluffyFreak wrote:Keep issues separate, the rendering of ships etc aren't the same as the rendering of planets or stars or gas giants.
I don't think rendering object beyond the range at which they can be resolved visually is going to be much different regardless of object in question.
It will always boil down to representing a point of light in the most convincing manner possible, and basing its brightness on (ideally) distance and amount of light emitted/reflected (the latter can be found on per light source basis by finding the angle between observer, object and light source, assuming we know object's size and albedo), so the same routine could be used to draw all sorts of objects that should be visible, but can no longer be rendered in a meaningful manner as 3D meshes.
We're not reverting that change, it contains a lot of good changes!
Such as?

(NOTE: I don't mean reverting the entire commit, I mean reinstating the spikies rendering.)

I'm not hell bent on using spikes instead of billboards, however, as currently implemented:
-they aren't rendered correctly for distant objects - spikies were.
-they don't account for lighting affecting object they represent - spikies did.
-they do piss poor job looking as if they were *bright* points of light - they just look like dull, fuzzy dots.

It seems like bringing spikies back is the simplest fix possible, they did perfectly adequate job doing what they were meant to, and it's hard to envision what they might possibly fail at given that they are meant to represent objects from several pixels to way sub-pixel size that just can't show any details that would require more involved display technique - so why not use something that just works?
FluffyFreak
Posts: 1343
Joined: Tue Jul 02, 2013 1:49 pm
Location: Beeston, Nottinghamshire, GB
Contact:

Re: Draw distances are broken

Post by FluffyFreak »

DraQ wrote:
We're not reverting that change, it contains a lot of good changes!
Such as?
Such as all of the camera refactoring that encapsulated a lot of it's functionality instead of requiring anything that use it to pull all of the information out and do the work itself to determine the camera frame. It gave us a context we could pass around and associate with camera objects so we can better support multiple cameras.

The other thing, as noted by the comments in the spike code, is that it's complete rubbish. Not only that but looking through it is horrible, there's even a call to a glGet* function in there that I spent weeks removing from the rest of the codebase :(

I'm making some changes right now so that planets always get a billboard, and only smaller objects won't be drawn below a sub-pixel size threshold. That means they won't disappear whilst still 2 pixels across, but they still will once they're below 0.5 pixels wide.

I'm trying to work out what I can do about faked billboard lighting to give it better colour etc whilst I'm in there.
Post Reply