From 5426ceada853cd2c36b19da246022acb2c59d817 Mon Sep 17 00:00:00 2001 From: dexy Date: Tue, 4 May 2021 18:42:41 +1000 Subject: [PATCH] Fix for lodlights intensity --- CodeWalker.Shaders/LightPS.hlsli | 2 +- .../Project/Panels/GenerateLODLightsPanel.cs | 2 +- Shaders/LodLightsPS.cso | Bin 5984 -> 5984 bytes Shaders/LodLightsPS_MS.cso | Bin 34116 -> 34116 bytes 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeWalker.Shaders/LightPS.hlsli b/CodeWalker.Shaders/LightPS.hlsli index bbb80cf..a7b27ec 100644 --- a/CodeWalker.Shaders/LightPS.hlsli +++ b/CodeWalker.Shaders/LightPS.hlsli @@ -129,7 +129,7 @@ float4 DeferredLODLight(float3 camRel, float3 norm, float4 diffuse, float4 specu if (ldist <= 0) return 0; float4 rgbi = Unpack4x8UNF(lodlight.Colour).gbar; - float3 lcol = rgbi.rgb * rgbi.a * 100.0f; + float3 lcol = rgbi.rgb * rgbi.a * 96.0f; float3 ldir = srpos / ldist; float pclit = saturate(dot(ldir, norm)); float lamt = 1; diff --git a/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs b/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs index 9ce10b2..6026074 100644 --- a/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs +++ b/CodeWalker/Project/Panels/GenerateLODLightsPanel.cs @@ -128,7 +128,7 @@ namespace CodeWalker.Project.Panels uint r = la.ColorR; uint g = la.ColorG; uint b = la.ColorB; - uint i = (byte)Math.Min(la.Intensity*4, 255); + uint i = (byte)Math.Max(Math.Min(Math.Round(la.Intensity * 5.3125f), 255), 0);//5.1=255/48 uint c = (i << 24) + (r << 16) + (g << 8) + b; uint h = elight.Hash; diff --git a/Shaders/LodLightsPS.cso b/Shaders/LodLightsPS.cso index 257f251f3f8b5874a80dc90abbfe8efd5df1bb23..220072dd52fbc7ebbf552b9dc7cfffd59c6eae33 100644 GIT binary patch delta 44 xcmaE$_drj?CBn)1l=hAJ-3$s}KhE8+yZdUl$wrY+e4GcI7#P5KGe3VI2LQYB5#s;= delta 44 xcmaE$_drj?CBn)1!g7D9xZ97`-d`;dAe7S=yHVs5ALj`t1_m(R%+DXl0RXG<5h(xw diff --git a/Shaders/LodLightsPS_MS.cso b/Shaders/LodLightsPS_MS.cso index 9944ef6189032a0f984b09a6d3cb2b9540dea881..7231982b6645e5e1bb441feb78dda847b384400f 100644 GIT binary patch delta 175 zcmX@o#dM^LNyH_>$vJPA8E2+{&?NS(OFw`9SiE_oNEScm0Vf6qFy7qGzaE)uFW-#H sy~w_Kj@c%5BpvqhKrszBOtCGYC}R1sm`0r`K~^%^US4(cnwl9L0Lm3UD*ylh delta 175 zcmX@o#dM^LNyH_>$@$!Y_nQ|>w9dS^-Q2xF$@t<%kt}}B6HW{aV7$4Ve?2nSUcMQX sdy#$f9J5XANILB0fnpkNm||N(QN;3NF^xJ?f~;h+y}at?H8nFh05|bJ8UO$Q