Prof-Butts / xwa_ddraw_d3d11

Direct3D 11 implementation of DDraw.dll for XWA with VR support and New Shaders
MIT License
6 stars 4 forks source link

Cockpit shadow moves with headtracking #86

Open morallo opened 1 year ago

morallo commented 1 year ago

I realized that the cockpit shadows move slightly when you move your head in VR mode. This should not happen, as long as the ship does not move, the shadows should be static with respect to the cockpit model.

It happens both with raytracing and shadow mapping modes.

Any ideas why this could be @Prof-Butts ?

Prof-Butts commented 1 year ago

Yeah, I think the shadow map is probably computed at the wrong time. It should be computed after the head tracking has been applied, but maybe it's done before that (?) so that's why there's a small delay. Maybe the fix is to apply the "head transform delta" when computing the shadow map (?)