Guest User

FLMaterial

a guest
Dec 2nd, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 21.36 KB | None | 0 0
  1. float4 Ac;
  2. Texture2D Bt;
  3. float4 Dc;
  4. Texture2D Dm;
  5. Texture2D Dm0;
  6. Texture2D Dm1;
  7. Texture2D Dt;
  8. float4 Ec;
  9. Texture2D Et;
  10. float Oc;
  11. float Alpha;
  12. float Fade;
  13. uint FlipU;
  14. uint FlipV;
  15. float Scale;
  16. float TileRate;
  17. float TileRate0;
  18. float TileRate1;
  19. float4 Inner;
  20. float4 Outer;
  21. TextureCube Cube;
  22.  
  23. SamplerState Sampler;
  24. RasterizerState Raster[2];
  25.  
  26. cbuffer Main
  27. {
  28.     float4x4 WVP;
  29.     float4x4 World;
  30.     float4x4 View;
  31.     float4x4 Proj;
  32.     float4x4 Local;
  33.     float3 Location;
  34.     uint FVF;
  35.     bool Instance;
  36. };
  37.  
  38. cbuffer Illumination
  39. {
  40.     bool Ambient;
  41.     float3 AmbientColor;
  42.     bool Lights;
  43.     int LightsCount;
  44.     float3 LightsPos[9];
  45.     float3 LightsColor[9];
  46.     float3 LightsAtten[9];
  47.     float LightsRange[9];
  48.     int LightsDirect[9];
  49. };
  50.  
  51.  
  52. cbuffer Picture
  53. {
  54.     float Brightness = 1;
  55.     float Contrast = 1;
  56.     float Gamma = 1;
  57. };
  58.  
  59. BlendState Transparent
  60. {
  61.         BlendEnable[0] = TRUE;
  62.         SrcBlend = SRC_ALPHA;
  63.         DestBlend = INV_SRC_ALPHA;
  64.         BlendOp = ADD;
  65.         SrcBlendAlpha = ONE;
  66.         DestBlendAlpha = ONE;
  67.         BlendOpAlpha = ADD;
  68.         RenderTargetWriteMask[0] = 0x0F;   
  69. };
  70.  
  71. BlendState Starsphere
  72. {
  73.         BlendEnable[0] = TRUE;
  74.         SrcBlend = SRC_ALPHA;
  75.         DestBlend = ONE;
  76.         BlendOp = ADD;
  77.         SrcBlendAlpha = ONE;
  78.         DestBlendAlpha = ONE;
  79.         BlendOpAlpha = ADD;
  80.         RenderTargetWriteMask[0] = 0x0F;   
  81. };
  82.  
  83. SamplerState Linear
  84. {
  85.     Filter = MIN_MAG_MIP_LINEAR;
  86. };
  87.  
  88. SamplerState Anisotropic
  89. {
  90.     Filter = ANISOTROPIC;
  91. };
  92.  
  93. struct TVertex
  94. {
  95.         float4 pos     : SV_POSITION;
  96.         float2 tex     : TEXCOORD1;
  97.     float2 tex2    : TEXCOORD2;
  98.         float3 normal  : NORMAL;
  99.     float3 tangent : TANGENT;
  100.         float4 color   : COLOR0;
  101.     float4 tm0     : Transform0;
  102.     float4 tm1     : Transform1;
  103.     float4 tm2     : Transform2;
  104.     float4 tm3     : Transform3;
  105.     float3 origin  : Originpos;
  106.     float3 local   : Localpos;
  107. };
  108.  
  109. //--------------------------------------------------------------------------------------
  110. // VS
  111. //--------------------------------------------------------------------------------------
  112. TVertex VS ( float4 Pos: POSITION, float2 Tex: TEXCOORD1, float2 Tex2: TEXCOORD2, float3 Normal: NORMAL, float4 Color: COLOR0, float4 TM0: Transform0, float4 TM1: Transform1, float4 TM2: Transform2, float4 TM3: Transform3)
  113. {
  114.         TVertex output = (TVertex)0;
  115.     float4x4 Mat = Local;
  116.     if (Instance)
  117.     {
  118.         Mat = mul(Mat, float4x4(TM0, TM1, TM2, TM3));
  119.     }
  120.     output.local = mul(mul(Pos, Mat), World);
  121.     output.normal = normalize(mul(Normal, Mat));
  122.     Mat = mul(Mat, WVP);
  123.     output.pos = mul(Pos, Mat);
  124.     output.tex = Tex;
  125.     output.tex2 = Tex2;
  126.         output.color = Color;
  127.     output.origin = mul(Pos, World);
  128.         return output;
  129. }
  130.  
  131. //--------------------------------------------------------------------------------------
  132. // PS
  133. //--------------------------------------------------------------------------------------
  134. float4 PS (TVertex input) : SV_TARGET
  135. {
  136.     return input.color;
  137. }
  138.  
  139. //--------------------------------------------------------------------------------------
  140. // PXLight
  141. //--------------------------------------------------------------------------------------
  142. float4 PXLight (TVertex input, float4 tex) : SV_TARGET
  143. {
  144.     if (FVF == 0x142)
  145.     {
  146.         tex *= input.color;
  147.     }
  148.     if ((FVF == 0x012 | FVF == 0x112 | FVF == 0x212) & (LightsCount > 0))
  149.     {
  150.         float3 d = float3(0,0,0);
  151.         float3 p = float3(0,0,0);
  152.         float lum = (0.299*AmbientColor.r) + (0.587*AmbientColor.g) + (0.114*AmbientColor.b);
  153.         d = AmbientColor.rgb;// * Ac.rgb;
  154.         for (int i = 0; i < LightsCount; i++)
  155.             if (LightsDirect[i] == 1)
  156.             {
  157.                 float dist = distance(LightsPos[i], input.local);
  158.                 if (LightsRange[i] >= dist)
  159.                 {
  160.                     float3 dir = normalize(LightsPos[i].xyz - input.local.xyz);
  161.                     float3 clr = saturate(LightsColor[i] * dot(input.normal, dir));
  162.                     float angle = dot(input.normal, dir);
  163.                     d += clr * Dc.rgb;// + AmbientColor.rgb * Ac.rgb;
  164.                 }
  165.             }
  166.         for (int i = 0; i < LightsCount; i++)
  167.             if (LightsDirect[i] == 0)
  168.             {
  169.                 float dist = distance(LightsPos[i], input.local);
  170.                 if (LightsRange[i] >= dist)
  171.                 {
  172.                     float3 dir = normalize(LightsPos[i].xyz - input.local.xyz);
  173.                     float3 clr = saturate(LightsColor[i] * dot(input.normal, dir));
  174.                     p += clr * Dc.rgb;
  175.                 }
  176.             }
  177.         tex.rgb *= saturate(d+p);
  178.     }
  179.     return tex;
  180.  
  181. }
  182.  
  183. //--------------------------------------------------------------------------------------
  184. // PXBrightness
  185. //--------------------------------------------------------------------------------------
  186. float4 PXBrightness (float4 tex) : SV_TARGET
  187. {
  188.     tex.rgb *= float3(Brightness,Brightness,Brightness);
  189.     return tex;
  190. }
  191.  
  192. //--------------------------------------------------------------------------------------
  193. // PXContrast
  194. //--------------------------------------------------------------------------------------
  195. float4 PXContrast (float4 tex) : SV_TARGET
  196. {
  197.     tex.rgb -= float3(0.5,0.5,0.5);
  198.     tex.rgb *= max(Contrast, 0);
  199.     tex.rgb += float3(0.5,0.5,0.5);
  200.     return tex;
  201. }
  202.  
  203. float4 PXGamma(float4 tex) : SV_TARGET
  204. {
  205.     return pow(tex, 1/Gamma);
  206. }
  207.  
  208. float4 PXBlend(float4 base, float4 blend)
  209. {
  210.     float3 br = clamp(sign(base.rgb - float3(0.5,0.5,0.5)), float3(0,0,0), float3(1,1,1));
  211.         float3 multiply = 2.0 * base.rgb * blend.rgb;
  212.         float3 screen = float3(1,1,1) - 2.0 * (float3(1,1,1) - base.rgb)*(float3(1,1,1) - blend.rgb);
  213.         float3 overlay = lerp(multiply, screen, br);
  214.         return float4(overlay, 1);
  215. }
  216.  
  217. //--------------------------------------------------------------------------------------
  218. // PX
  219. //--------------------------------------------------------------------------------------
  220. float4 PX (TVertex input, float4 tex) : SV_TARGET
  221. {
  222.     if (Lights)
  223.     {
  224.         tex = PXLight(input, tex);
  225.     }
  226.     return tex;
  227. }
  228.  
  229. float4 PXPost (float4 tex) : SV_TARGET
  230. {
  231.     tex = PXBrightness(tex);
  232.     tex = PXContrast(tex);
  233.     tex = PXGamma(tex);
  234.     return tex;
  235. };
  236.  
  237.  
  238.  
  239.  
  240.  
  241. //--------------------------------------------------------------------------------------
  242. // ColorPS
  243. //--------------------------------------------------------------------------------------
  244. float4 ColorPS (TVertex input) : SV_TARGET
  245. {
  246.     return Dc;
  247. }
  248. //--------------------------------------------------------------------------------------
  249. // DcDt
  250. //--------------------------------------------------------------------------------------
  251. float4 DcDtPS (TVertex input) : SV_TARGET
  252. {
  253.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  254.     clip (tex.a - 0.01);
  255.     return PXPost(PX(input, tex));
  256. }
  257.  
  258. //--------------------------------------------------------------------------------------
  259. // DcDtOcOt
  260. //--------------------------------------------------------------------------------------
  261. float4 DcDtOcOtPS (TVertex input) : SV_TARGET
  262. {
  263.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  264.     tex.a *= Oc;
  265.     clip (tex.a - 0.01);
  266.     return PXPost(PX(input, tex));
  267. }
  268.  
  269. //--------------------------------------------------------------------------------------
  270. // DcDtBt
  271. //--------------------------------------------------------------------------------------
  272. float4 DcDtBtPS (TVertex input) : SV_TARGET
  273. {
  274.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  275.     //float4 bump = Bt.Sample(Anisotropic, input.tex2);
  276.     //tex *= bump;
  277.     return PXPost(PX(input, tex));
  278. }
  279.  
  280. //--------------------------------------------------------------------------------------
  281. // DcDtBtOcOtPS
  282. //--------------------------------------------------------------------------------------
  283. float4 DcDtBtOcOtPS (TVertex input) : SV_TARGET
  284. {
  285.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  286.     //float4 bump = Bt.Sample (Anisotropic, input.tex2);
  287.     //tex *= bump;
  288.     tex.a *= Oc;
  289.     clip (tex.a - 0.01);
  290.     return PXPost(PX(input, tex));
  291. }
  292.  
  293. //--------------------------------------------------------------------------------------
  294. // DcDtBtEcPS
  295. //--------------------------------------------------------------------------------------
  296. float4 DcDtBtEcPS (TVertex input) : SV_TARGET
  297. {
  298.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  299.     //float4 bump = Bt.Sample(Anisotropic, input.tex2);
  300.     //tex *= bump;
  301.     tex *= Ec;
  302.     return PXPost(PX(input, tex));
  303. }
  304.  
  305. //--------------------------------------------------------------------------------------
  306. // DcDtBtEcEtPS
  307. //--------------------------------------------------------------------------------------
  308. float4 DcDtBtEcEtPS (TVertex input) : SV_TARGET
  309. {
  310.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  311.     tex = PX(input, tex);
  312.     //float4 bump = Bt.Sample (Anisotropic, input.tex2);
  313.     float4 illum = Et.Sample (Anisotropic, input.tex);
  314.     illum *= Ec;
  315.     //tex *= bump;
  316.     tex += illum;
  317.     return PXPost(tex);
  318. }
  319.  
  320. //--------------------------------------------------------------------------------------
  321. // DcDtEc
  322. //--------------------------------------------------------------------------------------
  323. float4 DcDtEcPS (TVertex input) : SV_TARGET
  324. {
  325.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  326.     tex *= Ec;
  327.     return PXPost(PX(input, tex));
  328. }
  329.  
  330. //--------------------------------------------------------------------------------------
  331. // DcDtEt
  332. //--------------------------------------------------------------------------------------
  333. float4 DcDtEtPS (TVertex input) : SV_TARGET
  334. {
  335.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  336.     tex = PX(input, tex);
  337.     float4 illum = Et.Sample (Anisotropic, input.tex);
  338.     tex += illum;  
  339.     return PXPost(tex);
  340. }
  341.  
  342. //--------------------------------------------------------------------------------------
  343. // DcDtEcEt
  344. //--------------------------------------------------------------------------------------
  345. float4 DcDtEcEtPS (TVertex input) : SV_TARGET
  346. {
  347.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  348.     tex = PX(input, tex);
  349.     float4 illum = Et.Sample (Anisotropic, input.tex);
  350.     illum *= Ec;
  351.     tex += illum;
  352.     return PXPost(tex);
  353. }
  354.  
  355. //--------------------------------------------------------------------------------------
  356. // DcDtEcOcOt
  357. //--------------------------------------------------------------------------------------
  358. float4 DcDtEcOcOtPS (TVertex input) : SV_TARGET
  359. {
  360.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  361.     tex.a *= Oc;
  362.     tex *= Ec;
  363.     clip (tex.a - 0.01);
  364.     return PXPost(PX(input, tex));
  365. }
  366.  
  367. //--------------------------------------------------------------------------------------
  368. // Nebula
  369. //--------------------------------------------------------------------------------------
  370. float4 NebulaPS (TVertex input) : SV_TARGET
  371. {
  372.     float4 tex = Dt.Sample (Anisotropic, input.tex);
  373.     [branch] if (FVF == 0x142)
  374.     {
  375.         tex *= input.color;
  376.         tex *= Ec;
  377.         return PXPost(PX(input, tex));
  378.     }
  379.     else
  380.     {  
  381.             return PXPost(PX(input, tex));
  382.     }  
  383. }
  384.  
  385. //--------------------------------------------------------------------------------------
  386. // AtmospherePS
  387. //--------------------------------------------------------------------------------------
  388. float4 AtmospherePS (TVertex input) : SV_TARGET
  389. {
  390.     float3 dir = normalize(Location - input.local.xyz);
  391.     float angle = clamp(dot(input.normal * Fade, dir),0,1);
  392.     float4 tex = Dt.Sample(Anisotropic, float2(angle,angle));
  393.     tex = PX(input, tex);
  394.     float lum = (0.299*tex.r) + (0.587*tex.g) + (0.114*tex.b);
  395.     tex.rgb = float3(lum,lum,lum) * (Dc * Ac + AmbientColor);
  396.     tex.a *= Alpha;
  397.  
  398.     //tex.rgb = float3(lum,lum,lum) * Dc * Ac;
  399.     //tex.a *= Alpha;
  400.    
  401.     //tex = PX(input, tex * Fade);
  402.     //tex *= Dc * Ac;
  403.     //tex.a *= Alpha;
  404.     //tex = clamp(tex,0,1);
  405.     return PXPost(tex);
  406. };
  407.  
  408. //--------------------------------------------------------------------------------------
  409. // DetailMapPS
  410. //--------------------------------------------------------------------------------------
  411. float4 DetailMapPS (TVertex input) : SV_TARGET
  412. {
  413.     float2 texcoord = input.tex;
  414.     if (FlipU) texcoord.x = 1 - texcoord.x;
  415.     if (FlipV) texcoord.y = 1 - texcoord.y;
  416.    
  417.     float3 pos = reflect(input.origin, float4(0,1,0,0));
  418.     float4 tex = Cube.Sample (Anisotropic, pos);
  419.  
  420.     texcoord *= TileRate;
  421.     float4 detail = Dm.Sample (Anisotropic, texcoord);
  422.     float4 details = lerp(detail, detail, tex.a);
  423.     tex *= details * sqrt(2);
  424.     return PXPost(PX(input, tex));
  425. }
  426.  
  427. //--------------------------------------------------------------------------------------
  428. // DetailMap2Dm1Msk2PassPS
  429. //--------------------------------------------------------------------------------------
  430. float4 DetailMap2Dm1Msk2PassPS (TVertex input) : SV_TARGET
  431. {
  432.     float2 texcoord = input.tex;
  433.     if (FlipU) texcoord.x = 1 - texcoord.x;
  434.     if (FlipV) texcoord.y = 1 - texcoord.y;
  435.  
  436.     float3 pos = reflect(input.origin, float4(0,1,0,0));
  437.     float4 tex = Cube.Sample (Anisotropic, pos);
  438.  
  439.     texcoord *= TileRate;
  440.     float4 detail1 = Dm1.Sample (Anisotropic, texcoord);
  441.     float4 details = lerp(detail1, detail1, tex.a);
  442.     tex *= details * sqrt(2);
  443.     return PXPost(PX(input, tex));
  444. }
  445.  
  446. //--------------------------------------------------------------------------------------
  447. // Masked2DetailMapPS
  448. //--------------------------------------------------------------------------------------
  449. float4 Masked2DetailMapPS (TVertex input) : SV_TARGET
  450. {
  451.     float2 texcoord = input.tex;
  452.     if (FlipU) texcoord.x = 1 - texcoord.x;
  453.     if (FlipV) texcoord.y = 1 - texcoord.y;
  454.    
  455.     float3 pos = reflect(input.origin, float4(0,1,0,0));
  456.     float4 tex = Cube.Sample (Anisotropic, pos);
  457.  
  458.     float2 texcoord0 = texcoord * TileRate0;
  459.     float4 detail0 = Dm0.Sample (Anisotropic, texcoord0);
  460.     float2 texcoord1 = texcoord * TileRate1;
  461.     float4 detail1 = Dm1.Sample (Anisotropic, texcoord1);
  462.     float4 details = lerp(detail0, detail1, tex.a);
  463.     tex *= details * sqrt(2);
  464.     return PXPost(PX(input, tex));
  465. }
  466.  
  467. //--------------------------------------------------------------------------------------
  468. // IllumDetailMapPS
  469. //--------------------------------------------------------------------------------------
  470. float4 IllumDetailMapPS (TVertex input) : SV_TARGET
  471. {
  472.     float2 texcoord = input.tex;
  473.     if (FlipU) texcoord.x = 1 - texcoord.x;
  474.     if (FlipV) texcoord.y = 1 - texcoord.y;
  475.    
  476.     float3 pos = reflect(input.origin, float4(0,1,0,0));
  477.     float4 tex = Cube.Sample (Anisotropic, pos);
  478.  
  479.     float2 texcoord0 = texcoord * TileRate0;
  480.     float4 detail0 = Dm0.Sample (Anisotropic, texcoord0);
  481.     float2 texcoord1 = texcoord * TileRate1;
  482.     float4 detail1 = Dm1.Sample (Anisotropic, texcoord1);
  483.     float4 details = lerp(detail0, detail1, tex.a);
  484.     tex *= details * sqrt(2);
  485.     return PXPost(PX(input, tex));
  486. }
  487.  
  488. //--------------------------------------------------------------------------------------
  489. // Techniques
  490. // The very first technique and its first pass is used to create the general Input Layout (FLVertex).
  491. //--------------------------------------------------------------------------------------
  492. technique10 FLVertex
  493. {
  494.     pass p0
  495.     {
  496.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  497.         SetPixelShader( CompileShader( ps_4_0, PS() ) );
  498.     }
  499. }
  500. technique10 DcDt
  501. {
  502.     pass p0
  503.     {
  504.         SetRasterizerState( Raster[0] );
  505.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  506.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  507.         SetPixelShader( CompileShader( ps_4_0, DcDtPS() ) );
  508.     }
  509. }
  510. technique10 DcDtTwo
  511. {
  512.     pass p0
  513.     {
  514.         SetRasterizerState( Raster[1] );
  515.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  516.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  517.         SetPixelShader( CompileShader( ps_4_0, DcDtPS() ) );
  518.     }
  519.     pass p1
  520.     {
  521.         SetRasterizerState( Raster[0] );
  522.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  523.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  524.         SetPixelShader( CompileShader( ps_4_0, DcDtPS() ) );
  525.     }
  526. }
  527. technique10 DcDtOcOt
  528. {
  529.     pass p0
  530.     {
  531.         SetRasterizerState( Raster[0] );
  532.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  533.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  534.         SetPixelShader( CompileShader( ps_4_0, DcDtOcOtPS() ) );
  535.     }
  536. }
  537. technique10 DcDtOcOtTwo
  538. {
  539.     pass p0
  540.     {
  541.         SetRasterizerState( Raster[1] );
  542.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  543.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  544.         SetPixelShader( CompileShader( ps_4_0, DcDtOcOtPS() ) );
  545.     }
  546.     pass p1
  547.     {
  548.         SetRasterizerState( Raster[0] );
  549.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  550.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  551.         SetPixelShader( CompileShader( ps_4_0, DcDtOcOtPS() ) );
  552.     }
  553.  
  554. }
  555. technique10 DcDtBt
  556. {
  557.     pass p0
  558.     {
  559.         SetRasterizerState( Raster[0] );
  560.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  561.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  562.         SetPixelShader( CompileShader( ps_4_0, DcDtBtPS() ) );
  563.     }
  564. }
  565. technique10 DcDtBtTwo
  566. {
  567.     pass p0
  568.     {
  569.         SetRasterizerState( Raster[1] );
  570.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  571.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  572.         SetPixelShader( CompileShader( ps_4_0, DcDtBtPS() ) );
  573.     }
  574.     pass p1
  575.     {
  576.         SetRasterizerState( Raster[0] );
  577.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  578.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  579.         SetPixelShader( CompileShader( ps_4_0, DcDtBtPS() ) );
  580.     }
  581. }
  582. technique10 DcDtBtEc
  583. {
  584.     pass p0
  585.     {
  586.         SetRasterizerState( Raster[0] );
  587.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  588.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  589.         SetPixelShader( CompileShader( ps_4_0, DcDtBtEcPS() ) );
  590.     }
  591. }
  592. technique10 DcDtBtEcEt
  593. {
  594.     pass p0
  595.     {
  596.         SetRasterizerState( Raster[0] );
  597.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  598.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  599.         SetPixelShader( CompileShader( ps_4_0, DcDtBtEcEtPS() ) );
  600.     }
  601. }
  602. technique10 DcDtBtOcOt
  603. {
  604.     pass p0
  605.     {
  606.         SetRasterizerState( Raster[0] );
  607.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  608.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  609.         SetPixelShader( CompileShader( ps_4_0, DcDtBtOcOtPS() ) );
  610.     }
  611. }
  612. technique10 DcDtBtOcOtTwo
  613. {
  614.     pass p0
  615.     {
  616.         SetRasterizerState( Raster[1] );
  617.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  618.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  619.         SetPixelShader( CompileShader( ps_4_0, DcDtBtOcOtPS() ) );
  620.     }
  621.     pass p1
  622.     {
  623.         SetRasterizerState( Raster[0] );
  624.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  625.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  626.         SetPixelShader( CompileShader( ps_4_0, DcDtBtOcOtPS() ) );
  627.     }
  628. }
  629. technique10 DcDtEc
  630. {
  631.     pass p0
  632.     {
  633.         SetRasterizerState( Raster[0] );
  634.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  635.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  636.         SetPixelShader( CompileShader( ps_4_0, DcDtEcPS() ) );
  637.     }
  638. }
  639. technique10 DcDtEt
  640. {
  641.     pass p0
  642.     {
  643.         SetRasterizerState( Raster[0] );
  644.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF );
  645.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  646.         SetPixelShader( CompileShader( ps_4_0, DcDtEtPS() ) );
  647.     }
  648. }
  649. technique10 DcDtEcEt
  650. {
  651.     pass p0
  652.     {
  653.         SetRasterizerState( Raster[0] );
  654.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  655.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  656.         SetPixelShader( CompileShader( ps_4_0, DcDtEcEtPS() ) );
  657.     }
  658. }
  659. technique10 DcDtEcOcOt
  660. {
  661.     pass p0
  662.     {
  663.         SetRasterizerState( Raster[0] );
  664.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF ); 
  665.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  666.         SetPixelShader( CompileShader( ps_4_0, DcDtEcOcOtPS() ) );
  667.     }  
  668. }
  669. technique10 DcDtEcOcOtTwo
  670. {
  671.     pass p0
  672.     {
  673.         SetRasterizerState( Raster[1] );
  674.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF ); 
  675.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  676.         SetPixelShader( CompileShader( ps_4_0, DcDtEcOcOtPS() ) );
  677.     }
  678.     pass p1
  679.     {
  680.         SetRasterizerState( Raster[0] );
  681.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF ); 
  682.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  683.         SetPixelShader( CompileShader( ps_4_0, DcDtEcOcOtPS() ) );
  684.     }  
  685. }
  686. technique10 Nebula
  687. {
  688.     pass p0
  689.     {
  690.         SetRasterizerState( Raster[0] );
  691.         SetBlendState( Starsphere, float4(0,0,0,0), 0xFFFFFFFF );  
  692.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  693.         SetPixelShader( CompileShader( ps_4_0, NebulaPS() ) );
  694.     }
  695.  
  696. }
  697. technique10 NebulaTwo
  698. {
  699.     pass p0
  700.     {
  701.         SetRasterizerState( Raster[1] );
  702.         SetBlendState( Starsphere, float4(0,0,0,0), 0xFFFFFFFF );  
  703.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  704.         SetPixelShader( CompileShader( ps_4_0, NebulaPS() ) );
  705.     }
  706.     pass p1
  707.     {
  708.         SetRasterizerState( Raster[0] );
  709.         SetBlendState( Starsphere, float4(0,0,0,0), 0xFFFFFFFF );  
  710.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  711.         SetPixelShader( CompileShader( ps_4_0, NebulaPS() ) );
  712.     }
  713. }
  714. technique10 Atmosphere
  715. {
  716.     pass p0
  717.     {
  718.         SetRasterizerState( Raster[0] );
  719.         SetBlendState( Transparent, float4(0,0,0,0), 0xFFFFFFFF ); 
  720.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  721.         SetPixelShader( CompileShader( ps_4_0, AtmospherePS() ) );
  722.     }
  723. }
  724. technique10 DetailMap
  725. {
  726.     pass p0
  727.     {
  728.         SetRasterizerState( Raster[0] );
  729.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  730.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  731.         SetPixelShader( CompileShader( ps_4_0, DetailMapPS() ) );
  732.     }
  733. }
  734. technique10 DetailMap2Dm1Msk2Pass
  735. {
  736.     pass p0
  737.     {
  738.         SetRasterizerState( Raster[0] );
  739.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  740.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  741.         SetPixelShader( CompileShader( ps_4_0, DetailMap2Dm1Msk2PassPS() ) );
  742.     }
  743. }
  744. technique10 Masked2DetailMap
  745. {
  746.     pass p0
  747.     {
  748.         SetRasterizerState( Raster[0] );
  749.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  750.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  751.         SetPixelShader( CompileShader( ps_4_0, Masked2DetailMapPS () ) );
  752.     }
  753. }
  754. technique10 IllumDetailMap
  755. {
  756.     pass p0
  757.     {
  758.         SetRasterizerState( Raster[0] );
  759.         SetBlendState( NULL, float4(0,0,0,0), 0xFFFFFFFF );
  760.         SetVertexShader( CompileShader( vs_4_0, VS() ) );
  761.         SetPixelShader( CompileShader( ps_4_0, IllumDetailMapPS() ) );
  762.     }
  763. }
Add Comment
Please, Sign In to add comment