mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-12 02:01:29 -10:00
This moves all lighting operations into the deferred shading phase of the rendering pipeline. Previously, directional lights were applied to all objects while they were being rendered. This was probably done to avoid doing multiple full screen passes later but caused some problems since the color information in the G-buffers was not correct for doing later lighting operations. This was especially noticable in dark scenes where point lights would appear to ignore the color of the rendered objects. This should be fixed with these changes. I did some performance testing and to my surprise this actually improves performance in very demanding scenes. My guess would be that applying the shadows while rendering the objects caused a lot of overdraw which is not the case anymore since shadows are only computed for visible pixels. In simple scenes the opposite happens which leads to decreased performance in those cases but in my opinion the improvement in demanding scenes outweights this performance decrease.