From 8983966d0fe1fed12cd2b83fc300c09c9bc01d52 Mon Sep 17 00:00:00 2001 From: Arc Earth Date: Mon, 14 Jul 2025 23:42:38 +0800 Subject: [PATCH] Fix ViewDirection not working for Wave mesh The wavelet nif is not a skinned/envmap/parallax mesh But it should still have a proper world matrix and view direction. RenderDoc capture shows its current ViewVector is mostly -input.Position. With the eye position fixed, I think we should always use the world position instead model space position. --- package/Shaders/Lighting.hlsl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package/Shaders/Lighting.hlsl b/package/Shaders/Lighting.hlsl index c1ff12e6f1..17ced04848 100644 --- a/package/Shaders/Lighting.hlsl +++ b/package/Shaders/Lighting.hlsl @@ -314,11 +314,7 @@ VS_OUTPUT main(VS_INPUT input) vsout.TexProj = TextureProj[eyeIndex][2].xyz; # endif -# if defined(ENVMAP) || defined(MULTI_LAYER_PARALLAX) || defined(SKINNED) vsout.ViewVector = EyePosition[eyeIndex].xyz - worldPosition.xyz; -# else - vsout.ViewVector = EyePosition[eyeIndex].xyz - input.Position.xyz; -# endif # if defined(EYE) precise float4 modelEyeCenter = float4(LeftEyeCenter.xyz + input.EyeParameter.xxx * (RightEyeCenter.xyz - LeftEyeCenter.xyz), 1);