BasicEffect.fx 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. //-----------------------------------------------------------------------------
  2. // BasicEffect.fx
  3. //
  4. // This is a simple shader that supports 1 ambient and 3 directional lights.
  5. // All lighting computations happen in world space.
  6. //
  7. // Microsoft XNA Community Game Platform
  8. // Copyright (C) Microsoft Corporation. All rights reserved.
  9. //-----------------------------------------------------------------------------
  10. //-----------------------------------------------------------------------------
  11. // Texture sampler
  12. //-----------------------------------------------------------------------------
  13. uniform const texture BasicTexture;
  14. uniform const sampler TextureSampler : register(s0) = sampler_state
  15. {
  16. Texture = (BasicTexture);
  17. MipFilter = Linear;
  18. MinFilter = Linear;
  19. MagFilter = Linear;
  20. };
  21. //-----------------------------------------------------------------------------
  22. // Fog settings
  23. //-----------------------------------------------------------------------------
  24. uniform const float FogEnabled : register(c0);
  25. uniform const float FogStart : register(c1);
  26. uniform const float FogEnd : register(c2);
  27. uniform const float3 FogColor : register(c3);
  28. uniform const float3 EyePosition : register(c4); // in world space
  29. //-----------------------------------------------------------------------------
  30. // Material settings
  31. //-----------------------------------------------------------------------------
  32. uniform const float3 DiffuseColor : register(c5) = 1;
  33. uniform const float Alpha : register(c6) = 1;
  34. uniform const float3 EmissiveColor : register(c7) = 0;
  35. uniform const float3 SpecularColor : register(c8) = 1;
  36. uniform const float SpecularPower : register(c9) = 16;
  37. //-----------------------------------------------------------------------------
  38. // Lights
  39. // All directions and positions are in world space and must be unit vectors
  40. //-----------------------------------------------------------------------------
  41. uniform const float3 AmbientLightColor : register(c10);
  42. uniform const float3 DirLight0Direction : register(c11);
  43. uniform const float3 DirLight0DiffuseColor : register(c12);
  44. uniform const float3 DirLight0SpecularColor : register(c13);
  45. uniform const float3 DirLight1Direction : register(c14);
  46. uniform const float3 DirLight1DiffuseColor : register(c15);
  47. uniform const float3 DirLight1SpecularColor : register(c16);
  48. uniform const float3 DirLight2Direction : register(c17);
  49. uniform const float3 DirLight2DiffuseColor : register(c18);
  50. uniform const float3 DirLight2SpecularColor : register(c19);
  51. //-----------------------------------------------------------------------------
  52. // Matrices
  53. //-----------------------------------------------------------------------------
  54. uniform const float4x4 World : register(vs, c20); // 20 - 23
  55. uniform const float4x4 View : register(vs, c24); // 24 - 27
  56. uniform const float4x4 Projection : register(vs, c28); // 28 - 31
  57. //-----------------------------------------------------------------------------
  58. // Structure definitions
  59. //-----------------------------------------------------------------------------
  60. struct ColorPair
  61. {
  62. float3 Diffuse;
  63. float3 Specular;
  64. };
  65. struct CommonVSOutput
  66. {
  67. float4 Pos_ws;
  68. float4 Pos_ps;
  69. float4 Diffuse;
  70. float3 Specular;
  71. float FogFactor;
  72. };
  73. //-----------------------------------------------------------------------------
  74. // Shader I/O structures
  75. // Nm: Normal
  76. // Tx: Texture
  77. // Vc: Vertex color
  78. //
  79. // Nm Tx Vc
  80. // 0 0 0 VSInput
  81. // 0 0 1 VSInputVc
  82. // 0 1 0 VSInputTx
  83. // 0 1 1 VSInputTxVc
  84. // 1 0 0 VSInputNm
  85. // 1 0 1 VSInputNmVc
  86. // 1 1 0 VSInputNmTx
  87. // 1 1 1 VSInputNmTxVc
  88. //-----------------------------------------------------------------------------
  89. // Vertex shader inputs
  90. //-----------------------------------------------------------------------------
  91. struct VSInput
  92. {
  93. float4 Position : POSITION;
  94. };
  95. struct VSInputVc
  96. {
  97. float4 Position : POSITION;
  98. float4 Color : COLOR;
  99. };
  100. struct VSInputNm
  101. {
  102. float4 Position : POSITION;
  103. float3 Normal : NORMAL;
  104. };
  105. struct VSInputNmVc
  106. {
  107. float4 Position : POSITION;
  108. float3 Normal : NORMAL;
  109. float4 Color : COLOR;
  110. };
  111. struct VSInputTx
  112. {
  113. float4 Position : POSITION;
  114. float2 TexCoord : TEXCOORD0;
  115. };
  116. struct VSInputTxVc
  117. {
  118. float4 Position : POSITION;
  119. float2 TexCoord : TEXCOORD0;
  120. float4 Color : COLOR;
  121. };
  122. struct VSInputNmTx
  123. {
  124. float4 Position : POSITION;
  125. float2 TexCoord : TEXCOORD0;
  126. float3 Normal : NORMAL;
  127. };
  128. struct VSInputNmTxVc
  129. {
  130. float4 Position : POSITION;
  131. float2 TexCoord : TEXCOORD0;
  132. float3 Normal : NORMAL;
  133. float4 Color : COLOR;
  134. };
  135. //-----------------------------------------------------------------------------
  136. // Vertex shader outputs
  137. //-----------------------------------------------------------------------------
  138. struct VertexLightingVSOutput
  139. {
  140. float4 PositionPS : POSITION; // Position in projection space
  141. float4 Diffuse : COLOR0;
  142. float4 Specular : COLOR1; // Specular.rgb and fog factor
  143. };
  144. struct VertexLightingVSOutputTx
  145. {
  146. float4 PositionPS : POSITION; // Position in projection space
  147. float4 Diffuse : COLOR0;
  148. float4 Specular : COLOR1;
  149. float2 TexCoord : TEXCOORD0;
  150. };
  151. struct PixelLightingVSOutput
  152. {
  153. float4 PositionPS : POSITION; // Position in projection space
  154. float4 PositionWS : TEXCOORD0;
  155. float3 NormalWS : TEXCOORD1;
  156. float4 Diffuse : COLOR0; // diffuse.rgb and alpha
  157. };
  158. struct PixelLightingVSOutputTx
  159. {
  160. float4 PositionPS : POSITION; // Position in projection space
  161. float2 TexCoord : TEXCOORD0;
  162. float4 PositionWS : TEXCOORD1;
  163. float3 NormalWS : TEXCOORD2;
  164. float4 Diffuse : COLOR0; // diffuse.rgb and alpha
  165. };
  166. //-----------------------------------------------------------------------------
  167. // Pixel shader inputs
  168. //-----------------------------------------------------------------------------
  169. struct VertexLightingPSInput
  170. {
  171. float4 Diffuse : COLOR0;
  172. float4 Specular : COLOR1;
  173. };
  174. struct VertexLightingPSInputTx
  175. {
  176. float4 Diffuse : COLOR0;
  177. float4 Specular : COLOR1;
  178. float2 TexCoord : TEXCOORD0;
  179. };
  180. struct PixelLightingPSInput
  181. {
  182. float4 PositionWS : TEXCOORD0;
  183. float3 NormalWS : TEXCOORD1;
  184. float4 Diffuse : COLOR0; // diffuse.rgb and alpha
  185. };
  186. struct PixelLightingPSInputTx
  187. {
  188. float2 TexCoord : TEXCOORD0;
  189. float4 PositionWS : TEXCOORD1;
  190. float3 NormalWS : TEXCOORD2;
  191. float4 Diffuse : COLOR0; // diffuse.rgb and alpha
  192. };
  193. //-----------------------------------------------------------------------------
  194. // Compute lighting
  195. // E: Eye-Vector
  196. // N: Unit vector normal in world space
  197. //-----------------------------------------------------------------------------
  198. ColorPair ComputeLights(float3 E, float3 N)
  199. {
  200. ColorPair result;
  201. result.Diffuse = AmbientLightColor;
  202. result.Specular = 0;
  203. // Directional Light 0
  204. float3 L = -DirLight0Direction;
  205. float3 H = normalize(E + L);
  206. float2 ret = lit(dot(N, L), dot(N, H), SpecularPower).yz;
  207. result.Diffuse += DirLight0DiffuseColor * ret.x;
  208. result.Specular += DirLight0SpecularColor * ret.y;
  209. // Directional Light 1
  210. L = -DirLight1Direction;
  211. H = normalize(E + L);
  212. ret = lit(dot(N, L), dot(N, H), SpecularPower).yz;
  213. result.Diffuse += DirLight1DiffuseColor * ret.x;
  214. result.Specular += DirLight1SpecularColor * ret.y;
  215. // Directional Light 2
  216. L = -DirLight2Direction;
  217. H = normalize(E + L);
  218. ret = lit(dot(N, L), dot(N, H), SpecularPower).yz;
  219. result.Diffuse += DirLight2DiffuseColor * ret.x;
  220. result.Specular += DirLight2SpecularColor * ret.y;
  221. result.Diffuse *= DiffuseColor;
  222. result.Diffuse += EmissiveColor;
  223. result.Specular *= SpecularColor;
  224. return result;
  225. }
  226. //-----------------------------------------------------------------------------
  227. // Compute per-pixel lighting.
  228. // When compiling for pixel shader 2.0, the lit intrinsic uses more slots
  229. // than doing this directly ourselves, so we don't use the intrinsic.
  230. // E: Eye-Vector
  231. // N: Unit vector normal in world space
  232. //-----------------------------------------------------------------------------
  233. ColorPair ComputePerPixelLights(float3 E, float3 N)
  234. {
  235. ColorPair result;
  236. result.Diffuse = AmbientLightColor;
  237. result.Specular = 0;
  238. // Light0
  239. float3 L = -DirLight0Direction;
  240. float3 H = normalize(E + L);
  241. float dt = max(0,dot(L,N));
  242. result.Diffuse += DirLight0DiffuseColor * dt;
  243. if (dt != 0)
  244. result.Specular += DirLight0SpecularColor * pow(max(0,dot(H,N)), SpecularPower);
  245. // Light1
  246. L = -DirLight1Direction;
  247. H = normalize(E + L);
  248. dt = max(0,dot(L,N));
  249. result.Diffuse += DirLight1DiffuseColor * dt;
  250. if (dt != 0)
  251. result.Specular += DirLight1SpecularColor * pow(max(0,dot(H,N)), SpecularPower);
  252. // Light2
  253. L = -DirLight2Direction;
  254. H = normalize(E + L);
  255. dt = max(0,dot(L,N));
  256. result.Diffuse += DirLight2DiffuseColor * dt;
  257. if (dt != 0)
  258. result.Specular += DirLight2SpecularColor * pow(max(0,dot(H,N)), SpecularPower);
  259. result.Diffuse *= DiffuseColor;
  260. result.Diffuse += EmissiveColor;
  261. result.Specular *= SpecularColor;
  262. return result;
  263. }
  264. //-----------------------------------------------------------------------------
  265. // Compute fog factor
  266. //-----------------------------------------------------------------------------
  267. float ComputeFogFactor(float d)
  268. {
  269. return clamp((d - FogStart) / (FogEnd - FogStart), 0, 1) * FogEnabled;
  270. }
  271. CommonVSOutput ComputeCommonVSOutput(float4 position)
  272. {
  273. CommonVSOutput vout;
  274. float4 pos_ws = mul(position, World);
  275. float4 pos_vs = mul(pos_ws, View);
  276. float4 pos_ps = mul(pos_vs, Projection);
  277. vout.Pos_ws = pos_ws;
  278. vout.Pos_ps = pos_ps;
  279. vout.Diffuse = float4(DiffuseColor.rgb + EmissiveColor, Alpha);
  280. vout.Specular = 0;
  281. vout.FogFactor = ComputeFogFactor(length(EyePosition - pos_ws ));
  282. return vout;
  283. }
  284. CommonVSOutput ComputeCommonVSOutputWithLighting(float4 position, float3 normal)
  285. {
  286. CommonVSOutput vout;
  287. float4 pos_ws = mul(position, World);
  288. float4 pos_vs = mul(pos_ws, View);
  289. float4 pos_ps = mul(pos_vs, Projection);
  290. vout.Pos_ws = pos_ws;
  291. vout.Pos_ps = pos_ps;
  292. float3 N = normalize(mul(normal, World));
  293. float3 posToEye = EyePosition - pos_ws;
  294. float3 E = normalize(posToEye);
  295. ColorPair lightResult = ComputeLights(E, N);
  296. vout.Diffuse = float4(lightResult.Diffuse.rgb, Alpha);
  297. vout.Specular = lightResult.Specular;
  298. vout.FogFactor = ComputeFogFactor(length(posToEye));
  299. return vout;
  300. }
  301. //-----------------------------------------------------------------------------
  302. // Vertex shaders
  303. //-----------------------------------------------------------------------------
  304. VertexLightingVSOutput VSBasic(VSInput vin)
  305. {
  306. VertexLightingVSOutput vout;
  307. CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
  308. vout.PositionPS = cout.Pos_ps;
  309. vout.Diffuse = cout.Diffuse;
  310. vout.Specular = float4(cout.Specular, cout.FogFactor);
  311. return vout;
  312. }
  313. VertexLightingVSOutput VSBasicVc(VSInputVc vin)
  314. {
  315. VertexLightingVSOutput vout;
  316. CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
  317. vout.PositionPS = cout.Pos_ps;
  318. vout.Diffuse = cout.Diffuse * vin.Color;
  319. vout.Specular = float4(cout.Specular, cout.FogFactor);
  320. return vout;
  321. }
  322. VertexLightingVSOutput VSBasicNm(VSInputNm vin)
  323. {
  324. VertexLightingVSOutput vout;
  325. CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal);
  326. vout.PositionPS = cout.Pos_ps;
  327. vout.Diffuse = cout.Diffuse;
  328. vout.Specular = float4(cout.Specular, cout.FogFactor);
  329. return vout;
  330. }
  331. VertexLightingVSOutput VSBasicNmVc(VSInputNmVc vin)
  332. {
  333. VertexLightingVSOutput vout;
  334. CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal);
  335. vout.PositionPS = cout.Pos_ps;
  336. vout.Diffuse = cout.Diffuse * vin.Color;
  337. vout.Specular = float4(cout.Specular, cout.FogFactor);
  338. return vout;
  339. }
  340. VertexLightingVSOutputTx VSBasicTx(VSInputTx vin)
  341. {
  342. VertexLightingVSOutputTx vout;
  343. CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
  344. vout.PositionPS = cout.Pos_ps;
  345. vout.Diffuse = cout.Diffuse;
  346. vout.Specular = float4(cout.Specular, cout.FogFactor);
  347. vout.TexCoord = vin.TexCoord;
  348. return vout;
  349. }
  350. VertexLightingVSOutputTx VSBasicTxVc(VSInputTxVc vin)
  351. {
  352. VertexLightingVSOutputTx vout;
  353. CommonVSOutput cout = ComputeCommonVSOutput(vin.Position);
  354. vout.PositionPS = cout.Pos_ps;
  355. vout.Diffuse = cout.Diffuse * vin.Color;
  356. vout.Specular = float4(cout.Specular, cout.FogFactor);
  357. vout.TexCoord = vin.TexCoord;
  358. return vout;
  359. }
  360. VertexLightingVSOutputTx VSBasicNmTx(VSInputNmTx vin)
  361. {
  362. VertexLightingVSOutputTx vout;
  363. CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal);
  364. vout.PositionPS = cout.Pos_ps;
  365. vout.Diffuse = cout.Diffuse;
  366. vout.Specular = float4(cout.Specular, cout.FogFactor);
  367. vout.TexCoord = vin.TexCoord;
  368. return vout;
  369. }
  370. VertexLightingVSOutputTx VSBasicNmTxVc(VSInputNmTxVc vin)
  371. {
  372. VertexLightingVSOutputTx vout;
  373. CommonVSOutput cout = ComputeCommonVSOutputWithLighting(vin.Position, vin.Normal);
  374. vout.PositionPS = cout.Pos_ps;
  375. vout.Diffuse = cout.Diffuse * vin.Color;
  376. vout.Specular = float4(cout.Specular, cout.FogFactor);
  377. vout.TexCoord = vin.TexCoord;
  378. return vout;
  379. }
  380. //-----------------------------------------------------------------------------
  381. // Per-pixel lighting vertex shaders
  382. //-----------------------------------------------------------------------------
  383. PixelLightingVSOutput VSBasicPixelLightingNm(VSInputNm vin)
  384. {
  385. PixelLightingVSOutput vout;
  386. float4 pos_ws = mul(vin.Position, World);
  387. float4 pos_vs = mul(pos_ws, View);
  388. float4 pos_ps = mul(pos_vs, Projection);
  389. vout.PositionPS = pos_ps;
  390. vout.PositionWS.xyz = pos_ws.xyz;
  391. vout.PositionWS.w = ComputeFogFactor(length(EyePosition - pos_ws));
  392. vout.NormalWS = normalize(mul(vin.Normal, World));
  393. vout.Diffuse = float4(1, 1, 1, Alpha);
  394. return vout;
  395. }
  396. PixelLightingVSOutput VSBasicPixelLightingNmVc(VSInputNmVc vin)
  397. {
  398. PixelLightingVSOutput vout;
  399. float4 pos_ws = mul(vin.Position, World);
  400. float4 pos_vs = mul(pos_ws, View);
  401. float4 pos_ps = mul(pos_vs, Projection);
  402. vout.PositionPS = pos_ps;
  403. vout.PositionWS.xyz = pos_ws.xyz;
  404. vout.PositionWS.w = ComputeFogFactor(length(EyePosition - pos_ws));
  405. vout.NormalWS = normalize(mul(vin.Normal, World));
  406. vout.Diffuse.rgb = vin.Color.rgb;
  407. vout.Diffuse.a = vin.Color.a * Alpha;
  408. return vout;
  409. }
  410. PixelLightingVSOutputTx VSBasicPixelLightingNmTx(VSInputNmTx vin)
  411. {
  412. PixelLightingVSOutputTx vout;
  413. float4 pos_ws = mul(vin.Position, World);
  414. float4 pos_vs = mul(pos_ws, View);
  415. float4 pos_ps = mul(pos_vs, Projection);
  416. vout.PositionPS = pos_ps;
  417. vout.PositionWS.xyz = pos_ws.xyz;
  418. vout.PositionWS.w = ComputeFogFactor(length(EyePosition - pos_ws));
  419. vout.NormalWS = normalize(mul(vin.Normal, World));
  420. vout.Diffuse = float4(1, 1, 1, Alpha);
  421. vout.TexCoord = vin.TexCoord;
  422. return vout;
  423. }
  424. PixelLightingVSOutputTx VSBasicPixelLightingNmTxVc(VSInputNmTxVc vin)
  425. {
  426. PixelLightingVSOutputTx vout;
  427. float4 pos_ws = mul(vin.Position, World);
  428. float4 pos_vs = mul(pos_ws, View);
  429. float4 pos_ps = mul(pos_vs, Projection);
  430. vout.PositionPS = pos_ps;
  431. vout.PositionWS.xyz = pos_ws.xyz;
  432. vout.PositionWS.w = ComputeFogFactor(length(EyePosition - pos_ws));
  433. vout.NormalWS = normalize(mul(vin.Normal, World));
  434. vout.Diffuse.rgb = vin.Color.rgb;
  435. vout.Diffuse.a = vin.Color.a * Alpha;
  436. vout.TexCoord = vin.TexCoord;
  437. return vout;
  438. }
  439. //-----------------------------------------------------------------------------
  440. // Pixel shaders
  441. //-----------------------------------------------------------------------------
  442. float4 PSBasic(VertexLightingPSInput pin) : COLOR
  443. {
  444. float4 color = pin.Diffuse + float4(pin.Specular.rgb, 0);
  445. color.rgb = lerp(color.rgb, FogColor, pin.Specular.w);
  446. return color;
  447. }
  448. float4 PSBasicTx(VertexLightingPSInputTx pin) : COLOR
  449. {
  450. float4 color = tex2D(TextureSampler, pin.TexCoord) * pin.Diffuse + float4(pin.Specular.rgb, 0);
  451. color.rgb = lerp(color.rgb, FogColor, pin.Specular.w);
  452. return color;
  453. }
  454. float4 PSBasicPixelLighting(PixelLightingPSInput pin) : COLOR
  455. {
  456. float3 posToEye = EyePosition - pin.PositionWS.xyz;
  457. float3 N = normalize(pin.NormalWS);
  458. float3 E = normalize(posToEye);
  459. ColorPair lightResult = ComputePerPixelLights(E, N);
  460. float4 diffuse = float4(lightResult.Diffuse * pin.Diffuse.rgb, pin.Diffuse.a);
  461. float4 color = diffuse + float4(lightResult.Specular, 0);
  462. color.rgb = lerp(color.rgb, FogColor, pin.PositionWS.w);
  463. return color;
  464. }
  465. float4 PSBasicPixelLightingTx(PixelLightingPSInputTx pin) : COLOR
  466. {
  467. float3 posToEye = EyePosition - pin.PositionWS.xyz;
  468. float3 N = normalize(pin.NormalWS);
  469. float3 E = normalize(posToEye);
  470. ColorPair lightResult = ComputePerPixelLights(E, N);
  471. float4 diffuse = tex2D(TextureSampler, pin.TexCoord) * float4(lightResult.Diffuse * pin.Diffuse.rgb, pin.Diffuse.a);
  472. float4 color = diffuse + float4(lightResult.Specular, 0);
  473. color.rgb = lerp(color.rgb, FogColor, pin.PositionWS.w);
  474. return color;
  475. }
  476. //-----------------------------------------------------------------------------
  477. // Shader and technique definitions
  478. //-----------------------------------------------------------------------------
  479. int ShaderIndex = 0;
  480. VertexShader VSArray[12] =
  481. {
  482. compile vs_1_1 VSBasic(),
  483. compile vs_1_1 VSBasicVc(),
  484. compile vs_1_1 VSBasicTx(),
  485. compile vs_1_1 VSBasicTxVc(),
  486. compile vs_1_1 VSBasicNm(),
  487. compile vs_1_1 VSBasicNmVc(),
  488. compile vs_1_1 VSBasicNmTx(),
  489. compile vs_1_1 VSBasicNmTxVc(),
  490. compile vs_1_1 VSBasicPixelLightingNm(),
  491. compile vs_1_1 VSBasicPixelLightingNmVc(),
  492. compile vs_1_1 VSBasicPixelLightingNmTx(),
  493. compile vs_1_1 VSBasicPixelLightingNmTxVc(),
  494. };
  495. PixelShader PSArray[12] =
  496. {
  497. compile ps_1_1 PSBasic(),
  498. compile ps_1_1 PSBasic(),
  499. compile ps_1_1 PSBasicTx(),
  500. compile ps_1_1 PSBasicTx(),
  501. compile ps_1_1 PSBasic(),
  502. compile ps_1_1 PSBasic(),
  503. compile ps_1_1 PSBasicTx(),
  504. compile ps_1_1 PSBasicTx(),
  505. compile ps_2_0 PSBasicPixelLighting(),
  506. compile ps_2_0 PSBasicPixelLighting(),
  507. compile ps_2_0 PSBasicPixelLightingTx(),
  508. compile ps_2_0 PSBasicPixelLightingTx(),
  509. };
  510. Technique BasicEffect
  511. {
  512. Pass
  513. {
  514. VertexShader = (VSArray[ShaderIndex]);
  515. PixelShader = (PSArray[ShaderIndex]);
  516. }
  517. }