Commit MetaInfo

修订版376ae99f43ade9380b6c01a47ea21fc15808035a (tree)
时间2011-12-11 01:56:00
作者Jarmonik
CommiterJarmonik

Log Message

D3D9Client: CTDs and shadows fixed
* Energia CTD fixed.
* Surface base shadow offset fixed.

更改概述

差异

diff -r d96eb1845b25 -r 376ae99f43ad Modules/D3D9Client/Mesh.fx
--- a/Modules/D3D9Client/Mesh.fx Thu Dec 08 06:24:00 2011 +0100
+++ b/Modules/D3D9Client/Mesh.fx Sat Dec 10 17:56:00 2011 +0100
@@ -286,6 +286,18 @@
286286 return outVS;
287287 }
288288
289+HazeVS ShadowMeshTechExVS(MESH_VERTEX vrt)
290+{
291+ // Zero output.
292+ HazeVS outVS = (HazeVS)0;
293+ float d = dot(vrt.posL,vrt.posL);
294+ float3 posX = mul(float4(vrt.posL, 1.0f), gGrpT).xyz;
295+ float3 posW = mul(float4(posX-gColor.xyz*(gTexOff.x*d+gTexOff.y*d*d), 1.0f), gW).xyz;
296+ outVS.posH = mul(float4(posW, 1.0f), gVP);
297+
298+ return outVS;
299+}
300+
289301
290302 float4 ShadowTechPS(HazeVS frg) : COLOR
291303 {
@@ -313,6 +325,25 @@
313325 StencilFunc = NotEqual;
314326 StencilPass = Replace;
315327 }
328+
329+ pass P1
330+ {
331+ vertexShader = compile VS_MOD ShadowMeshTechExVS();
332+ pixelShader = compile PS_MOD ShadowTechPS();
333+
334+ AlphaBlendEnable = true;
335+ BlendOp = Add;
336+ SrcBlend = SrcAlpha;
337+ DestBlend = InvSrcAlpha;
338+ ZEnable = false;
339+ ZWriteEnable = false;
340+
341+ StencilEnable = true;
342+ StencilRef = 1;
343+ StencilMask = 1;
344+ StencilFunc = NotEqual;
345+ StencilPass = Replace;
346+ }
316347 }
317348
318349
diff -r d96eb1845b25 -r 376ae99f43ad Modules/D3D9ClientDebug/D3D9Client.fx
--- a/Modules/D3D9ClientDebug/D3D9Client.fx Thu Dec 08 06:24:00 2011 +0100
+++ b/Modules/D3D9ClientDebug/D3D9Client.fx Sat Dec 10 17:56:00 2011 +0100
@@ -3,8 +3,8 @@
33 // D3D9Client rendering techniques for Orbiter Spaceflight simulator
44 // -------------------------------------------------------------------------------------------------------------
55
6-#define LIGHT_BOOST 2.5f
7-#define AMB_ATTEN 0.4f
6+#define LIGHT_BOOST 2.0f
7+#define AMB_ATTEN 0.75f
88
99
1010 #define NIGHT_CLOUDS 0.05f // range(0.0f-0.1f) Cloud ambient level at night
diff -r d96eb1845b25 -r 376ae99f43ad Modules/D3D9ClientDebug/Mesh.fx
--- a/Modules/D3D9ClientDebug/Mesh.fx Thu Dec 08 06:24:00 2011 +0100
+++ b/Modules/D3D9ClientDebug/Mesh.fx Sat Dec 10 17:56:00 2011 +0100
@@ -288,6 +288,18 @@
288288 return outVS;
289289 }
290290
291+HazeVS ShadowMeshTechExVS(MESH_VERTEX vrt)
292+{
293+ // Zero output.
294+ HazeVS outVS = (HazeVS)0;
295+ float d = dot(vrt.posL,vrt.posL);
296+ float3 posX = mul(float4(vrt.posL, 1.0f), gGrpT).xyz;
297+ float3 posW = mul(float4(posX-gColor.xyz*(gTexOff.x*d+gTexOff.y*d*d), 1.0f), gW).xyz;
298+ outVS.posH = mul(float4(posW, 1.0f), gVP);
299+
300+ return outVS;
301+}
302+
291303
292304 float4 ShadowTechPS(HazeVS frg) : COLOR
293305 {
@@ -315,10 +327,30 @@
315327 StencilFunc = NotEqual;
316328 StencilPass = Replace;
317329 }
330+
331+ pass P1
332+ {
333+ vertexShader = compile VS_MOD ShadowMeshTechExVS();
334+ pixelShader = compile PS_MOD ShadowTechPS();
335+
336+ AlphaBlendEnable = true;
337+ BlendOp = Add;
338+ SrcBlend = SrcAlpha;
339+ DestBlend = InvSrcAlpha;
340+ ZEnable = false;
341+ ZWriteEnable = false;
342+
343+ StencilEnable = true;
344+ StencilRef = 1;
345+ StencilMask = 1;
346+ StencilFunc = NotEqual;
347+ StencilPass = Replace;
348+ }
318349 }
319350
320351
321352
353+
322354 // =============================================================================
323355 // Mesh Bounding Box Technique
324356 // =============================================================================
@@ -438,6 +470,7 @@
438470 DestBlend = InvSrcAlpha;
439471 ZEnable = false;
440472 ZWriteEnable = false;
473+ //CullMode = NONE;
441474 CullMode = CCW;
442475 }
443476
@@ -452,7 +485,8 @@
452485 DestBlend = InvSrcAlpha;
453486 ZEnable = false;
454487 ZWriteEnable = false;
455- CullMode = CCW;
488+ //CullMode = NONE;
489+ CullMode = CCW;
456490 }
457491 }
458492
diff -r d96eb1845b25 -r 376ae99f43ad Modules/D3D9TK.dll
Binary file Modules/D3D9TK.dll has changed
diff -r d96eb1845b25 -r 376ae99f43ad Modules/Plugin/D3D9Client.dll
Binary file Modules/Plugin/D3D9Client.dll has changed
Show on old repository browser