jorisvddonk / system-reset

System Reset - Re-implementation of Noctis IV, in Godot
9 stars 1 forks source link

Implement lighting effects onto the Stardrifter from nearby stars #13

Open jorisvddonk opened 1 year ago

jorisvddonk commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.