DrawDistance for effects And planets

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6680
Joined: Wed Feb 28, 2007 7:54 am

Re: DrawDistance for effects And planets

Post by another_commander »

Check cim's last response on PR#153 on github, it could contain info related to the reason for your problem and also gives a possible workaround method (could be tricky to implement without core changes but you never know till you give it a try):
https://github.com/OoliteProject/oolite/pull/153
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: DrawDistance for effects And planets

Post by Frame »

another_commander wrote: Sun Jan 15, 2017 10:03 am
Check cim's last response on PR#153 on github, it could contain info related to the reason for your problem and also gives a possible workaround method (could be tricky to implement without core changes but you never know till you give it a try):
https://github.com/OoliteProject/oolite/pull/153
Thanks for the heads up. I have tried different things with no succes. One thing strikes me as odd though.That is that even at beyond 2^32 range i can still see the atmosphere when forcing it via a little extra code(atmDistance>2^32:opacity = 0.75) in the atmosphere shader thus proving at point that a shader can operate at ranges above 2^32. So im thinking it is the planet shader that is somehow preventing rendering above those distances.

so i'm still tinkering, trying to find a solution.
Bounty Scanner
Number 935
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: DrawDistance for effects And planets

Post by cim »

Frame wrote: Mon Jan 16, 2017 3:35 pm
thus proving at point that a shader can operate at ranges above 2^32.
There's a difference between "operate" and "operate well" - the main limitation is the depth buffer, which because of the way they work has an effective range of only around 10^6 (and is getting a bit flaky once you go much beyond scanner range). The whole two-pass thing was supposed to give us the ability to go beyond the limitations of a single depth buffer ... but it's not at all straightforward to get right!

OOPlanetEntity.m line 600 onwards used to switch between "near" and "far" rendering modes for the atmosphere as the distance to the planet approached 10^6 - this was a very visible transition, so it currently uses "far" mode all the time. That still needs fixing up, and may have something to do with this.

2^32 isn't particularly relevant - OpenGL uses 32-bit floats, not 32-bit ints - so you just get increasing imprecision with increased distance. The absolute limit would be somewhere over 10^38 but you wouldn't be able to do anything useful with it.
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Re: DrawDistance for effects And planets

Post by Frame »

cim wrote: Tue Jan 17, 2017 9:40 pm
2^32 isn't particularly relevant
But it is at that exact distance the planet Completely vanishes, so it is relevant as a hint.

I tested so many things so i cant remember how this applies to the github source with pull request 153 applied.
Bounty Scanner
Number 935
Post Reply