sezero / quakespasm

QuakeSpasm -- A modern, cross-platform Quake game engine based on FitzQuake.
https://sourceforge.net/projects/quakespasm/
GNU General Public License v2.0
239 stars 96 forks source link

moving bmodels receive dynamic lighting from original position #94

Open maikmerten opened 9 months ago

maikmerten commented 9 months ago

This is an old bug inherited from WinQuake, which has been fixed in a number of ports, suchs as Ironwail and Quakespasm Spiked.

https://github.com/sezero/quakespasm/assets/2611432/9b4a06e3-889f-4d65-9c56-5dd9bcc2ae5b

Dynamic lights appear to be applied to bmodels according to their original origin, instead of their current position.

It may be possible to cherry-pick that fix from Ironwail or Quakespasm Spiked, provided the commits can be identified.

maikmerten commented 9 months ago

Quakespasm Spiked, which has this issue fixed, has modifications to R_DrawBrushModel to subtract light and model origins and subsequent changes in R_MarkLights. I ported those over to Quakespasm, which delivers a partial fix:

https://github.com/sezero/quakespasm/assets/2611432/69e4e4a3-a5a4-493a-8f31-227418370f22

qss-partial-fix.zip

The fix is only partial as the bmodel doesn't seem to receive any dlights once it moved away sufficiently away from its origin. Perhaps the port of the fix is incomplete or perhaps Quakespasm Spiked does further adjustments in other areas.

Find also enclosed my test map, which is a work-in-progress map I'm working on.

bossy.zip

maikmerten commented 9 months ago

Okay, the partial fix indeed is partial.

Quakespasm Spike introduced the complete thing in this commit:

https://github.com/Shpoike/Quakespasm/commit/f6d31e9db928cb058398ba9002ca4b2094a2926f

sezero commented 4 months ago

Quakespasm Spike introduced the complete thing in this commit:

Shpoike/Quakespasm@f6d31e9

Applying that commit to qs doesn't seem to work correctly - e.g. rockets doesn't light the path they travel at the least.

Maybe @Shpoike has a proper patch for QS. If not, this is not on my immediate TODO list.

CC: @ericwa

Diordany commented 2 months ago

For any future participants, please ignore the reference from the commit message 5eb3ac5. It originally referenced an unrelated issue from Ironwail.