Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement lighting effects onto the Stardrifter from nearby stars #13

Open
jorisvddonk opened this issue Aug 18, 2023 · 2 comments
Open
Labels
niv inaccuracy Something that has already been implemented, but is inaccurate when compared to how NIV behaves.

Comments

@jorisvddonk
Copy link
Owner

At the moment, lighting from nearby stars does not affect the lighting of the Stardrifter. This is because the Stardrifter is its own, separate scene from the local system where nearby stars are displayed. In Noctis IV, lighting from nearby stars significantly affected the appearance of the Stardrifter, so this is something that should be replicated in this project.

For your information, the scene tree of the project contains three viewports, that each render independently, and which synchronize camera rotation between them:

  1. The 'near space' scene contains the Stardrifter and its systems.
  2. The 'local space' scene contains the planets, moons, star and companion stars of the local system.
  3. The 'remote space' scene contains all stars that are not part of the local system.

These three scenes are rendered independently via viewports, and then composited together. Rationale for this architecture is that space is big, but in the engine stars and planets are actually quite small (typically less than 10 meters across) and we don't want any parallax effects to happen whenever the player walks around the Stardrifter. Hence why scenes are rendered independently and then composited togehter.

Unfortunately, this means that lights from one scene don't affect another. So these lighting effects have to be implemented in some other way

@jorisvddonk jorisvddonk added the niv inaccuracy Something that has already been implemented, but is inaccurate when compared to how NIV behaves. label Aug 18, 2023
@jorisvddonk
Copy link
Owner Author

Noctis IV's code contains some specific code for handling eclipses and such (if a planet is between a light source (star) and the Stardrifter, then lighting is affected accordingly). Could the original codebase's lighting be reused perhaps?

Alternatively, maybe some aspect oflighting can be replicated across scenes in a similar way to how the camera rotation is replicated across scenes; i.e. maybe we can create lights in the "near space" scene that mirror lights in "local space". That won't work for eclipses, though, so if we take that path then we'd have to account for eclipses separately.

jorisvddonk added a commit that referenced this issue Aug 26, 2023
@jorisvddonk
Copy link
Owner Author

jorisvddonk commented Aug 26, 2023

This has now been partially implemented; eclipses still need to be added, and the lighting doesn't mimic NIV's exactly (in NIV, light is only 'active' inside when the main window faces a nearby star).

Also, there is currently no support for binary stars.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
niv inaccuracy Something that has already been implemented, but is inaccurate when compared to how NIV behaves.
Projects
None yet
Development

No branches or pull requests

1 participant