mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
Vulkan: stop mirroring light shafts top to bottom (#8006)
The Vulkan light shaft pass reuses OpenGL's sun position formula, whose texture V grows upward. The Vulkan fullscreen triangle in post-v.sdr has V = 0 at the top of the screen, and ls-f.sdr steps from fragTexCoord toward sun_pos in that space, so the shafts radiated from a point mirrored vertically from the sun. Flip the vertical coordinate before upload. Co-authored-by: Saga port <saga-port@invalid> Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 file changed
+3
@@ -531,6 +531,9 @@ void VulkanLDR::executeLightshafts(vk::CommandBuffer cmd)
|
||||
if (dot > 0.7f) {
|
||||
sun_x = asinf_safe(vm_vec_dot(&light_dir, &Eye_matrix.vec.rvec)) / PI * 1.5f + 0.5f;
|
||||
sun_y = asinf_safe(vm_vec_dot(&light_dir, &Eye_matrix.vec.uvec)) / PI * 1.5f * gr_screen.clip_aspect + 0.5f;
|
||||
// The formula above is OpenGL's, whose texture V grows upward. The Vulkan fullscreen triangle in
|
||||
// post-v.sdr has V = 0 at the top of the screen, so flip to the space ls-f.sdr's fragTexCoord is in.
|
||||
sun_y = 1.0f - sun_y;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user