Commit MetaInfo

Revision641b20609e4fc0a8f0e2bf0c2bbc634ba652f0d9 (tree)
Time2019-04-14 16:42:40
Author <jarmonik@c0f5...>

Log Message

- Added Felix24's shadow fixes

Change Summary

Incremental Difference

diff -r eee82671f05c -r 641b20609e4f Modules/D3D9Client/Common.hlsl
--- a/Modules/D3D9Client/Common.hlsl Sat Apr 06 19:27:55 2019 +0000
+++ b/Modules/D3D9Client/Common.hlsl Sun Apr 14 07:42:40 2019 +0000
@@ -256,7 +256,7 @@
256256 float kr = gSHD[0] * KERNEL_RADIUS;
257257 float dx = rsqrt(1.0 - dLN*dLN);
258258 float ofs = kr / (dLN * dx);
259- float omx = min(0.07 + ofs, 0.3);
259+ float omx = min(0.05 + ofs, 0.5);
260260
261261 if (gBaseBuilding) {
262262
@@ -268,7 +268,6 @@
268268 // It's a vessel
269269 float pd = shdH.z + omx * gSHD[3];
270270 fShadow = SampleShadowsEx(sp, pd, sc);
271- //fShadow = smoothstep(0.3f, 1.0f, fShadow);
272271 }
273272
274273 return 1 - fShadow;
diff -r eee82671f05c -r 641b20609e4f Modules/D3D9Client/PBR.fx
--- a/Modules/D3D9Client/PBR.fx Sat Apr 06 19:27:55 2019 +0000
+++ b/Modules/D3D9Client/PBR.fx Sun Apr 14 07:42:40 2019 +0000
@@ -195,7 +195,7 @@
195195 // ----------------------------------------------------------------------
196196
197197 #if SHDMAP > 0
198- cSun *= ComputeShadow(frg.shdH, dLN, sc);
198+ cSun *= smoothstep(0, 0.72, ComputeShadow(frg.shdH, dLN, sc));
199199 #endif
200200
201201
@@ -453,7 +453,7 @@
453453 // ----------------------------------------------------------------------
454454
455455 #if SHDMAP > 0
456- float fShadow = ComputeShadow(frg.shdH, dLN, sc);
456+ float fShadow = smoothstep(0, 0.72, ComputeShadow(frg.shdH, dLN, sc));
457457 dLN *= fShadow;
458458 #endif
459459
diff -r eee82671f05c -r 641b20609e4f Orbitersdk/D3D9Client/Scene.cpp
--- a/Orbitersdk/D3D9Client/Scene.cpp Sat Apr 06 19:27:55 2019 +0000
+++ b/Orbitersdk/D3D9Client/Scene.cpp Sun Apr 14 07:42:40 2019 +0000
@@ -2111,7 +2111,7 @@
21112111 D3DXMatrixMultiply(&smap.mViewProj, &smap.mView, &smap.mProj);
21122112
21132113 float rs = float(ViewH()) * rad / (float(GetTanAp()) * D3DXVec3Length(&pos));
2114- float lod = log2f(float(Config->ShadowMapSize) / (rs));
2114+ float lod = log2f(float(Config->ShadowMapSize) / (rs*1.5f));
21152115
21162116 smap.lod = min(int(round(lod)), SHM_LOD_COUNT - 1);
21172117 smap.lod = max(smap.lod, 0);
Show on old repository browser