fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Merge Cockpit Renderpass into main deferred pass

Open BMagnu opened this issue 3 years ago • 0 comments

As discussed, this is the last followup item to #3445.

To implement this fix, the cockpit renderpass (ship_render_player_ship()) needs to be merged into the main render loop.

When doing this, there is a list of conditions that need to be considered:

  1. You must ensure that the cockpit, regardless of actual z-Distance, is always rendered in front of the show ship model
  2. You must ensure that both show ship and the cockpit models are rendered in front of effects which are rendered after the models, notably shields, trails, particles, beams, and nebulae.
  3. You must ensure that shadows are cast from cockpit and ship on both cockpit and ship, with shadow casting by the ship model being toggleable though a table flag.
  4. You must ensure that it is possible to disable deferred rendering for the show ship model / cross shadowing between that and the cockpit in the event that the cockpit model and show ship model do not properly share a correct coordinate space.
  5. You must ensure that shadows on the cockpit are rendered with different shadow distances to the rest of the models, to account for the much higher accuracy required for these low-distance shadows.
  6. You must ensure that lights are separately configurable in their effects, notably radius, for the cockpit / show ship models compared to the other models.
  7. You must ensure that cockpit and show ship models are rendered with a view matrix at (or at the very least close) to the origin, as any view matrix with a distance of over around a thousand units will cause very visible floating-point inaccuracy induced jittering.

BMagnu avatar Sep 24 '22 13:09 BMagnu