From 134521530a2c0f92c6b3ea07e3832b3c7f73117c Mon Sep 17 00:00:00 2001 From: Silent Date: Mon, 16 Jun 2014 15:38:24 +0200 Subject: [PATCH] Fixed buildings being too dark at night --- SilentPatch/nvc.fx | 2 +- SilentPatch/nvc.h | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/SilentPatch/nvc.fx b/SilentPatch/nvc.fx index c6435e5..123f2d8 100644 --- a/SilentPatch/nvc.fx +++ b/SilentPatch/nvc.fx @@ -24,7 +24,7 @@ VS_OUTPUT NVC_vertex_shader( in VS_INPUT In ) Out.Position = mul(In.Position, viewProjMatrix); Out.Texture = In.Texture; - Out.Color.rgb = (In.DayColor.rgb * (1.0-fEnvVars[0]) + In.NightColor.rgb * fEnvVars[0]) + (AmbientLight.rgb * AmbientLight.a); + Out.Color.rgb = (In.DayColor.rgb * (1.0-fEnvVars[0]) + In.NightColor.rgb * fEnvVars[0]) + AmbientLight.rgb; Out.Color.a = fEnvVars[1]; Out.Color = saturate(Out.Color); diff --git a/SilentPatch/nvc.h b/SilentPatch/nvc.h index 86226a4..c085f9a 100644 --- a/SilentPatch/nvc.h +++ b/SilentPatch/nvc.h @@ -36,7 +36,7 @@ add r0.x, r0.x, -c4.x mul r1.xyz, v2, c4.x mad r0.xzw, v3.xyyz, r0.x, r1.xyyz - mad r0.xzw, c5.xyyz, c5.w, r0 + add r0.xzw, r0, c5.xyyz max r1.xyz, r0.xzww, c6.y max r1.w, r0.y, c4.y min oD0, r1, c6.x @@ -121,19 +121,18 @@ const BYTE g_vs20_NVC_vertex_shader[] = 0, 160, 4, 0, 0, 4, 0, 0, 13, 128, 3, 0, 148, 144, 0, 0, 0, 128, - 1, 0, 148, 128, 4, 0, - 0, 4, 0, 0, 13, 128, - 5, 0, 148, 160, 5, 0, - 255, 160, 0, 0, 228, 128, + 1, 0, 148, 128, 2, 0, + 0, 3, 0, 0, 13, 128, + 0, 0, 228, 128, 5, 0, + 148, 160, 11, 0, 0, 3, + 1, 0, 7, 128, 0, 0, + 248, 128, 6, 0, 85, 160, 11, 0, 0, 3, 1, 0, - 7, 128, 0, 0, 248, 128, - 6, 0, 85, 160, 11, 0, - 0, 3, 1, 0, 8, 128, - 0, 0, 85, 128, 4, 0, - 85, 160, 10, 0, 0, 3, - 0, 0, 15, 208, 1, 0, - 228, 128, 6, 0, 0, 160, - 1, 0, 0, 2, 0, 0, - 3, 224, 1, 0, 228, 144, - 255, 255, 0, 0 + 8, 128, 0, 0, 85, 128, + 4, 0, 85, 160, 10, 0, + 0, 3, 0, 0, 15, 208, + 1, 0, 228, 128, 6, 0, + 0, 160, 1, 0, 0, 2, + 0, 0, 3, 224, 1, 0, + 228, 144, 255, 255, 0, 0 };