pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.58k stars 364 forks source link

Add interior lighting to stations #5823

Open tatjam opened 1 month ago

tatjam commented 1 month ago

Makes ships that are inside stations (as defined on the model file using tags and a series of new parser commands) have increased ambient light and reduced direct lightning, fixing the issue of black ships on eclipsed stations (Issue #4399).

TO-DO:

Demo: https://www.youtube.com/watch?v=D56iUkvpOac

impaktor commented 1 month ago

Adjustable lighting colors with some kind of station config?

Stations in Haber space are blood red.

fluffyfreak commented 1 month ago

That's an interesting approach, another might be to gather the nearest 3 or 4 lights from within the station and apply them as light sources to the ship. However I'm not sure if "lights" like that are defined in the model or if that's something that could be done later.

nozmajner commented 1 month ago

There are no lights in the model. I can add them if needed. Not sure if Blender lights are exported to collada, with their settings. Or they could be tags.

tatjam commented 1 month ago

Love the idea, that way it's more in-line with the new PBR renderer idea. Guess adjusting ambient lighting is useful even then, if no dynamical env-maps are used.

Even if actual lights are used I guess the interior checking is important, to prevent outside ships from being lit. (Otherwise shadow casting is needed, or really thick exterior walls).

nozmajner commented 1 month ago

I'd suggest first doing the ambient light only, get it to merge, and then you can think about the next step, or if you want to do other features instead. No need to build a huge PR, especially when you are still getting your feet wet. This is a free-time passion project after all, avoid burnout and such!

tatjam commented 1 month ago

If I'm not mistaken all stations use either hub A o B so that should be done. Going to quickly find a "A" type station to see if it works

nozmajner commented 1 month ago

Yes, all stations use those two hubs.

impaktor commented 1 month ago

@tatjam For testing big vs. small ships, I assume you're aware of Ctrl+i to change your ship model.

tatjam commented 1 month ago

Messed around a bit with various ships and a fixed fade value feels good. There's really not any ship that's so long its center is way outside the station before it visually is outside.

impaktor commented 1 month ago

@tatjam If you're feeling done, please rebase commits if/as needed, and remove draft status on PR

tatjam commented 1 month ago

Fine! The custom light feature could be implemented later on if needed.

impaktor commented 3 weeks ago

Going to need some review on this @Web-eWorks or/and @fluffyfreak

Web-eWorks commented 3 weeks ago

Will do - not had a chance to get to this yet but it's been on my TODO list.