Repository navigation
Ship landing improvements - #6372
Conversation
|
@bszlrd did this mockup 3 years ago, for added feature to the radar/scanner, which might be inspiring: Pioneer.Space.Sim.-.Mockup.of.suggested.new.feature.for.the.scanner.to.assist.manual.land.1720739002775384064.mp4 |
|
That one is more useful for pad landings, but it could be adapted. Should I do some mockups? |
|
I believe this closes #5208 |
|
I love this solution! The conceptual approach is hilariously janky in the best of ways, but I absolutely applaud your ingenuity (and audacity) in implementing ship shadows as a full-screen pseudo- deferred-rendering composite pass. Pending a closer code-and-performance review, I'm quite happy to merge this if for no other reason than as motivation to get working on a proper shadow-mapping implementation. |
|
Here's a save which shows a potential issue with the shadow (not an actual zip):
|
|
I've improved the terrain angle algorithm so that it copes better with ridges and valleys. Floating or strangely positioned shadows should be less common now. It's still possible to end up with something odd if you really try, especially on the crinkly bits of Mars. Still, I believe this now meets the bar for "good enough". I've also made @fluffyfreak's requested change, so it's ready for further review and merge. |
|
Does not cast any shadow here: |
|
From IRC: The situation in your save file is that it's close to sunset, so the shadow angle is very low, and the code decided not to draw any shadows. If you go back in time a bit (or more realistically go forward in time by a bit less than a day) you'll see the shadow is drawn most of the time, and then fades out as sunset approaches. Your save is just after it finished fading out. If you're playing with the code, you can set SHADOW_MAX_ANGLE and SHADOW_FADE_ANGLE to, say, 89 and 85, and then you may see why I decided not to draw the shadows at those shallow angles. |
|
@sam52796 can you rebase this? |
b3e1c7e to
a11b94c
Compare
|
I really want to merge this as I think it's great and an interesting approach to the lack of shadows. |
|
That loop starts sampling at 256m width, and then halves each iteration until it reaches the ship size. So for an average ship size it will do 4 or 5 iterations. A Xylophis might take 6. The minimum size it will consider is 1m, so even if we add nano probes in future it will still only do 8 iterations max. While reviewing I spotted that it's calling the surface normal function twice per iteration, when really it only needs to call it once. So I've fixed that in a new commit. |
|
Thanks 👍 |







I was playing Pioneer and trying to land a ship on a planet surface, and after a little while I thought "This should be easier".
If you've ever thought the same thing, then I have good news.
One issue preventing me from landing is that the ground was at an angle, and it took ages trying to rotate the ship in different directions to get it to "snap" to the landing state. Turns out the "correct" angle was strictly vertical. Even if the ground is at an angle, you were supposed to land your ship so that one edge is clipping into the ground and the other is in mid-air.
So the first commit here is for making landing on a planet easier by taking into account the terrain angle. The correct landing angle is now the same as the terrain angle - i.e. it's what you're looking at. I also made the tolerance a bit more generous. So you can align your ship with the ground and land a bit more easily.
The second commit is to add shadows cast by ships onto the ground and onto landing pads. It's a pretty crude render. If the shadow overlaps the edge of the landing pad then all bets are off. Just try not to pay attention to the shadows in that case. But landing in general is now slightly easier because the shadow tells you when you're approaching the ground in a more visually intuitive way than the altitude meter.
Or at least that's the idea. Feedback welcome.
(impaktor-EDIT: closes #5208, closes #6420)