enbbloom.fx 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. // M I D H R A S T I C E N B F O R F A L L O U T 3
  2. //++++++++++++++++++++++++++++++++++++++++++++
  3. // ENBSeries effect file
  4. // visit http://enbdev.com for updates
  5. // Copyright (c) 2007-2011 Boris Vorontsov
  6. // Tinting and Anamorphic Flare code courtesy of Matso
  7. //++++++++++++++++++++++++++++++++++++++++++++
  8. //+++++++++++++++++++++++++++++
  9. //internal parameters, can be modified
  10. //+++++++++++++++++++++++++++++
  11. #define USE_TINTING 1
  12. #define TINT_COLOR float3(0.77, 0.7, 0.825)
  13. #define TINT_TEXTURE tex2D(SamplerBloom6, In.txcoord0.xy).rgb
  14. #define TINT_LEVEL 1.3
  15. #define USE_ANAMFLARE 1 // comment it to disable anamorphic lens flare
  16. #if USE_TINTING == 1
  17. #define TINT TINT_COLOR
  18. #elseif USE_TINTING == 2
  19. #define TINT TINT_TEXTURE
  20. #endif
  21. //+++++++++++++++++++++++++++++
  22. //external parameters, do not modify
  23. //+++++++++++++++++++++++++++++
  24. //keyboard controlled temporary variables (in some versions exists in the config file). Press and hold key 1,2,3...8 together with PageUp or PageDown to modify. By default all set to 1.0
  25. float4 tempF1; //0,1,2,3
  26. float4 tempF2; //5,6,7,8
  27. float4 tempF3; //9,0
  28. //x=Width, y=1/Width, z=ScreenScaleY, w=1/ScreenScaleY
  29. float4 ScreenSize;
  30. //x=generic timer in range 0..1, period of 16777216 ms (4.6 hours), w=frame time elapsed (in seconds)
  31. float4 Timer;
  32. //additional info for computations
  33. float4 TempParameters;
  34. //Lenz reflection intensity, lenz reflection power
  35. float4 LenzParameters;
  36. //BloomRadius1, BloomRadius2, BloomBlueShiftAmount, BloomContrast
  37. float4 BloomParameters;
  38. // Anamorphic flare parameters
  39. #define fFlareLuminance 0.333 // bright pass luminance value
  40. #define fFlareBlur 200.0 // manages the size of the flare //200
  41. #define fFlareIntensity 0.10 // effect intensity
  42. // MIDHRAS - Use the settings below to adjust BloomRadius for the consecutive bloom passes.
  43. //#define BloomRadius0 0.282
  44. #define BloomRadius1 1.524
  45. #define BloomRadius2 1.524
  46. texture2D texBloom1;
  47. texture2D texBloom2;
  48. texture2D texBloom3;
  49. texture2D texBloom4;
  50. texture2D texBloom5;
  51. texture2D texBloom6;
  52. texture2D texBloom7;//additional bloom tex
  53. texture2D texBloom8;//additional bloom tex
  54. sampler2D SamplerBloom1 = sampler_state
  55. {
  56. Texture = <texBloom1>;
  57. MinFilter = LINEAR;
  58. MagFilter = LINEAR;
  59. MipFilter = NONE;//NONE;
  60. AddressU = Clamp;
  61. AddressV = Clamp;
  62. SRGBTexture=FALSE;
  63. MaxMipLevel=0;
  64. MipMapLodBias=0;
  65. };
  66. sampler2D SamplerBloom2 = sampler_state
  67. {
  68. Texture = <texBloom2>;
  69. MinFilter = LINEAR;
  70. MagFilter = LINEAR;
  71. MipFilter = NONE;//NONE;
  72. AddressU = Clamp;
  73. AddressV = Clamp;
  74. SRGBTexture=FALSE;
  75. MaxMipLevel=0;
  76. MipMapLodBias=0;
  77. };
  78. sampler2D SamplerBloom3 = sampler_state
  79. {
  80. Texture = <texBloom3>;
  81. MinFilter = LINEAR;
  82. MagFilter = LINEAR;
  83. MipFilter = NONE;//NONE;
  84. AddressU = Clamp;
  85. AddressV = Clamp;
  86. SRGBTexture=FALSE;
  87. MaxMipLevel=0;
  88. MipMapLodBias=0;
  89. };
  90. sampler2D SamplerBloom4 = sampler_state
  91. {
  92. Texture = <texBloom4>;
  93. MinFilter = LINEAR;
  94. MagFilter = LINEAR;
  95. MipFilter = NONE;//NONE;
  96. AddressU = Clamp;
  97. AddressV = Clamp;
  98. SRGBTexture=FALSE;
  99. MaxMipLevel=0;
  100. MipMapLodBias=0;
  101. };
  102. sampler2D SamplerBloom5 = sampler_state
  103. {
  104. Texture = <texBloom5>;
  105. MinFilter = LINEAR;
  106. MagFilter = LINEAR;
  107. MipFilter = NONE;//NONE;
  108. AddressU = Clamp;
  109. AddressV = Clamp;
  110. SRGBTexture=FALSE;
  111. MaxMipLevel=0;
  112. MipMapLodBias=0;
  113. };
  114. sampler2D SamplerBloom6 = sampler_state
  115. {
  116. Texture = <texBloom6>;
  117. MinFilter = LINEAR;
  118. MagFilter = LINEAR;
  119. MipFilter = NONE;//NONE;
  120. AddressU = Clamp;
  121. AddressV = Clamp;
  122. SRGBTexture=FALSE;
  123. MaxMipLevel=0;
  124. MipMapLodBias=0;
  125. };
  126. sampler2D SamplerBloom7 = sampler_state
  127. {
  128. Texture = <texBloom7>;
  129. MinFilter = LINEAR;
  130. MagFilter = LINEAR;
  131. MipFilter = NONE;//NONE;
  132. AddressU = Clamp;
  133. AddressV = Clamp;
  134. SRGBTexture=FALSE;
  135. MaxMipLevel=0;
  136. MipMapLodBias=0;
  137. };
  138. sampler2D SamplerBloom8 = sampler_state
  139. {
  140. Texture = <texBloom8>;
  141. MinFilter = LINEAR;
  142. MagFilter = LINEAR;
  143. MipFilter = NONE;//NONE;
  144. AddressU = Clamp;
  145. AddressV = Clamp;
  146. SRGBTexture=FALSE;
  147. MaxMipLevel=0;
  148. MipMapLodBias=0;
  149. };
  150. struct VS_OUTPUT_POST
  151. {
  152. float4 vpos : POSITION;
  153. float2 txcoord0 : TEXCOORD0;
  154. };
  155. struct VS_INPUT_POST
  156. {
  157. float3 pos : POSITION;
  158. float2 txcoord0 : TEXCOORD0;
  159. };
  160. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  161. //
  162. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  163. VS_OUTPUT_POST VS_Bloom(VS_INPUT_POST IN)
  164. {
  165. VS_OUTPUT_POST OUT;
  166. OUT.vpos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);
  167. OUT.txcoord0.xy=IN.txcoord0.xy+TempParameters.xy;//1.0/(bloomtexsize*2.0)
  168. return OUT;
  169. }
  170. /**
  171. * Bright pass - rescales sampled pixel to emboss bright enough value.
  172. */
  173. float3 BrightPass(float2 tex)
  174. {
  175. float3 c = tex2D(SamplerBloom2, tex).rgb;
  176. float3 bC = max(c - float3(fFlareLuminance, fFlareLuminance, fFlareLuminance), 0.0);
  177. float bright = dot(bC, 1.0);
  178. bright = smoothstep(0.0f, 0.5, bright);
  179. return lerp(0.0, c, bright);
  180. }
  181. /**
  182. * Anamorphic sampling function - scales pixel coordinate
  183. * to stratch the image along one of the axels.
  184. * (http://en.wikipedia.org/wiki/Anamorphosis)
  185. */
  186. float3 AnamorphicSample(int axis, float2 tex, float blur)
  187. {
  188. tex = 2.0 * tex - 1.0;
  189. if (!axis) tex.x /= -blur;
  190. else tex.y /= -blur;
  191. tex = 0.5 * tex + 0.5;
  192. return BrightPass(tex);
  193. }
  194. /**
  195. * Converts pixel color to gray-scale.
  196. */
  197. float GrayScale(float3 sample)
  198. {
  199. return dot(sample, float3(0.3, 0.59, 0.11));
  200. }
  201. // Constants ///////////////////////////////////////////////////////////////
  202. const float2 bloomOffset[8]=
  203. {
  204. float2(0.707, 0.707),
  205. float2(0.707, -0.707),
  206. float2(-0.707, 0.707),
  207. float2(-0.707, -0.707),
  208. float2(0.0, 1.0),
  209. float2(0.0, -1.0),
  210. float2(1.0, 0.0),
  211. float2(-1.0, 0.0)
  212. };
  213. // deepness, curvature, inverse size
  214. const float3 offset[4]=
  215. {
  216. float3(1.6, 4.0, 1.0),
  217. float3(0.7, 0.25, 2.0),
  218. float3(0.3, 1.5, 0.5),
  219. float3(-0.5, 1.0, 1.0)
  220. };
  221. // color filter per reflection
  222. const float3 factors[4]=
  223. {
  224. float3(0.3, 0.4, 0.4),
  225. float3(0.2, 0.4, 0.5),
  226. float3(0.5, 0.3, 0.7),
  227. float3(0.1, 0.2, 0.7)
  228. };
  229. ////////////////////////////////////////////////////////////////////////////
  230. // Anamorphic lens flare pixel shader (Matso code)
  231. float4 PS_ProcessPass_Anamorphic(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
  232. {
  233. float4 res;
  234. float2 coord = IN.txcoord0.xy;
  235. //MIDHRAS - Anamorphic flare can be used in various ways: if you set all RGB-values to a single identical number, the AF will take on the colour of the light it's triggered by. However, setting only one RGB value, or any combination of the three using different numbers, allows you to set the colour of the flare. The higher the numbers, the more opaque and strong the flares.
  236. float3 anamFlare = AnamorphicSample(0, coord.xy, fFlareBlur) * float3(0.35, 0.35, 0.35); //trichromatic Anamorphic Flare (adaptive)
  237. //float3 anamFlare = AnamorphicSample(0, coord.xy, fFlareBlur) * float3(0.75, 0.55, 0.0); //monochromatic Anamorphic Flare RED
  238. //float3 anamFlare = AnamorphicSample(0, coord.xy, fFlareBlur) * float3(0.0, 0.55, 0.0); //monochromatic Anamorphic Flare GREEN
  239. //float3 anamFlare = AnamorphicSample(0, coord.xy, fFlareBlur) * float3(0.0, 0.0, 1.0); //monochromatic Anamorphic Flare BLUE
  240. //MIDHRAS - The RGB values for the float3 values above can be used to set the colour of the AnamFlare. Putting them all at the same values results in an anamFlare that takes on the colour of the light that causes it. Putting two values to 0 will give you a flare in the colour of the parameter that you gave a value above zero. the higher the number, the more opaque the flare.
  241. res.rgb = anamFlare * fFlareIntensity;
  242. res.a = 1.0;
  243. return res;
  244. }
  245. //zero pass HQ, input texture is fullscreen
  246. //SamplerBloom1 - fullscreen texture
  247. float4 PS_BloomPrePass(VS_OUTPUT_POST In) : COLOR
  248. {
  249. float4 bloomuv;
  250. float4 bloom=0.05;//MIDHRAS - 0.0 //tex2D(SamplerBloom1, In.txcoord0);
  251. const float2 offset[4]=
  252. {
  253. float2(0.25, 1.25),
  254. float2(0.25, -0.25),
  255. float2(-0.25, 0.25),
  256. float2(-0.25, -0.25)
  257. };
  258. //TempParameters.w==1 if first pass, ==2 is second pass
  259. float2 screenfact=TempParameters.z;
  260. screenfact.y*=ScreenSize.z;
  261. float4 srcbloom=bloom;
  262. for (int i=0; i<4; i++)
  263. {
  264. bloomuv.xy=offset[i];
  265. bloomuv.xy=(bloomuv.xy*screenfact.xy)+In.txcoord0.xy;
  266. float4 tempbloom=tex2D(SamplerBloom1, bloomuv.xy);
  267. bloom.xyz+=tempbloom.xyz;
  268. }
  269. bloom.xyz*=0.35;
  270. bloom.xyz=min(bloom.xyz, 32768.0);
  271. bloom.xyz=max(bloom.xyz, 0.0);
  272. return bloom;
  273. }
  274. //first and second passes draw to every texture
  275. //twice, after computations of these two passes,
  276. //result is set as input to next cycle
  277. //first pass
  278. //SamplerBloom1 is result of prepass or second pass from cycle
  279. float4 PS_BloomTexture1(VS_OUTPUT_POST In) : COLOR
  280. {
  281. float4 bloomuv;
  282. float4 bloom=tex2D(SamplerBloom1, In.txcoord0);
  283. const float2 offset[8]=
  284. {
  285. float2(1.0, 1.0),
  286. float2(1.0, -1.0),
  287. float2(-1.0, 1.0),
  288. float2(-1.0, -1.0),
  289. float2(0.0, 1.0),
  290. float2(0.0, -1.0),
  291. float2(1.0, 0.0),
  292. float2(-1.0, 0.0)
  293. };
  294. float2 screenfact=0.0017;
  295. screenfact.y*=ScreenSize.z;
  296. float4 srcbloom=bloom;
  297. //TempParameters.w == (1+passnumber)
  298. //float step=BloomParameters.x;//*pow(2.0, BloomParameters.x * (TempParameters.w-1.0));//*0.5
  299. float step = BloomRadius1 * BloomParameters.x; //MIDHRAS - uncomment if bloom radius control is needed (also set BloomRadius1 above).
  300. // float step=(TempParameters.w-0.25);//
  301. screenfact.xy*=step;//====================================================
  302. float4 bloomadd=bloom;
  303. for (int i=0; i<8; i++)
  304. {
  305. bloomuv.xy=offset[i];
  306. bloomuv.xy=(bloomuv.xy*screenfact.xy)+In.txcoord0.xy;//-(1.0/256.0);//-(1.0/512.0);
  307. float4 tempbloom=tex2D(SamplerBloom1, bloomuv.xy);
  308. bloom+=tempbloom;
  309. }
  310. bloom*=0.1111111;
  311. //////////////////////////////////////////////////////////////////////////////////
  312. #ifdef USE_TINTING
  313. float3 tint = TINT * TINT_LEVEL;
  314. float ttt = max(dot(bloom.xyz, 0.333) - dot(srcbloom.xyz, 0.111), 0.0);
  315. //float ttt = max(dot(bloom.xyz, 0.333) - dot(srcbloom.xyz, 0.333), 0.0);
  316. float gray = BloomParameters.z * ttt * 10.0;
  317. float mixfact = (gray / (1.0 + gray));
  318. mixfact *= 1.0 - saturate((TempParameters.w - 1.0) * 0.2);
  319. tint.xy += saturate((TempParameters.w - 1.0) * 0.3);
  320. tint.xy = saturate(tint.xy);
  321. bloom.xyz *= lerp(1.0, tint.xyz, mixfact);
  322. #endif
  323. //////////////////////////////////////////////////////////////////////////////////
  324. //MIDHRAS - dpeasant alternative to Matso's tinting code:
  325. /*
  326. //float3 violet=float3(0.78, 0.5, 1.0);
  327. float3 violet=float3(0.6, 0.4, 1.0);//v3
  328. // float3 violet=float3(0.27, 0.52, 1.0);//v4
  329. //this applies when white
  330. //float gray=0.104*dot(srcbloom.xyz, 0.333);//max(srcbloom.x, max(srcbloom.y, srcbloom.z));
  331. //this applies on dark and when contrast
  332. float ttt=dot(bloom.xyz, 0.333)-dot(srcbloom.xyz, 0.333);
  333. ttt=max(ttt, 0.0);
  334. float gray=BloomParameters.z*ttt*10;//max(srcbloom.x, max(srcbloom.y, srcbloom.z));
  335. float mixfact=(gray/(1.0+gray));
  336. mixfact*=1.0-saturate((TempParameters.w-1.0)*0.2);
  337. violet.xy+=saturate((TempParameters.w-1.0)*0.3);
  338. violet.xy=saturate(violet.xy);
  339. bloom.xyz*=lerp(1.0, violet.xyz, mixfact);
  340. */
  341. bloom.w=1.0;
  342. return bloom;
  343. }
  344. //second pass
  345. //SamplerBloom1 is result of first pass
  346. float4 PS_BloomTexture2(VS_OUTPUT_POST In) : COLOR
  347. {
  348. float4 bloomuv;
  349. float4 bloom=tex2D(SamplerBloom1, In.txcoord0);
  350. const float2 offset[8]=
  351. {
  352. float2(1.0, 1.0),
  353. float2(1.0, -1.0),
  354. float2(-1.0, 1.0),
  355. float2(-1.0, -1.0),
  356. float2(0.0, 1.0),
  357. float2(0.0, -1.0),
  358. float2(1.0, 0.0),
  359. float2(-1.0, 0.0)
  360. };
  361. float2 screenfact=0.0017;
  362. screenfact.y*=ScreenSize.z;
  363. float4 srcbloom=bloom;
  364. //TempParameters.w == (1+passnumber)
  365. // float step=(TempParameters.w-0.25);
  366. //float step=BloomParameters.y;//*pow(2.0, BloomParameters.y * (TempParameters.w-1.0))*2.0;//*0.5
  367. float step = BloomRadius2 * BloomParameters.y;
  368. screenfact.xy*=step;//*0.25====================================================
  369. float4 rotvec=0.0;
  370. sincos(0.3927, rotvec.x, rotvec.y);
  371. for (int i=0; i<8; i++)
  372. {
  373. bloomuv.xy=offset[i];
  374. bloomuv.xy=reflect(bloomuv.xy, rotvec.xy);///????????
  375. bloomuv.xy=(bloomuv.xy*screenfact.xy)+In.txcoord0.xy;
  376. float4 tempbloom=tex2D(SamplerBloom1, bloomuv.xy);
  377. bloom+=tempbloom;
  378. }
  379. bloom*=0.111111;
  380. float Saturation=-0.206;//todo modify this, negative or positive, you can move this at the beginning of shader file
  381. float middlegray=(bloom.r+bloom.g+bloom.b)*0.333;
  382. float3 diffcolor=bloom.rgb-middlegray;
  383. //bloom.rgb+=diffcolor*Saturation;
  384. //bloom.rgb=max(bloom.rgb, 0.0); //output must be never negative, but "saturate" also work here and faster.
  385. bloom.w=1.0;
  386. return bloom;
  387. }
  388. //last pass, mix several bloom textures
  389. //SamplerBloom5 is the result of prepass
  390. //float4 PS_BloomPostPass(float2 vPos : VPOS ) : COLOR
  391. float4 PS_BloomPostPass(VS_OUTPUT_POST In) : COLOR
  392. {
  393. float4 bloom;
  394. //v1
  395. bloom =tex2D(SamplerBloom1, In.txcoord0);
  396. bloom+=tex2D(SamplerBloom2, In.txcoord0);
  397. bloom+=tex2D(SamplerBloom3, In.txcoord0);
  398. bloom+=tex2D(SamplerBloom4, In.txcoord0);
  399. bloom+=tex2D(SamplerBloom7, In.txcoord0);
  400. bloom+=tex2D(SamplerBloom8, In.txcoord0);
  401. bloom+=tex2D(SamplerBloom5, In.txcoord0);
  402. // bloom+=tex2D(SamplerBloom6, In.txcoord0);
  403. bloom*=0.142857;
  404. float3 lenz=0;
  405. float2 lenzuv=0.0;
  406. //deepness, curvature, inverse size
  407. const float3 offset[4]=
  408. {
  409. float3(1.6, 4.0, 1.0),
  410. float3(0.7, 0.25, 2.0),
  411. float3(0.3, 1.5, 0.5),
  412. float3(-0.5, 1.0, 1.0)
  413. };
  414. //color filter per reflection
  415. const float3 factors[4]=
  416. {
  417. float3(0.3, 0.4, 0.4),
  418. float3(0.2, 0.4, 0.5),
  419. float3(0.5, 0.3, 0.7),
  420. float3(0.1, 0.2, 0.7)
  421. };
  422. //lenzuv.xy=0.5-lenzuv.xy;
  423. //distfact=0.5-lenzuv.xy-0.5;
  424. if (LenzParameters.x>0.00001)
  425. {
  426. for (int i=0; i<4; i++)
  427. {
  428. float2 distfact=(In.txcoord0.xy-0.5);
  429. lenzuv.xy=offset[i].x*distfact;
  430. lenzuv.xy*=pow(2.0*length(float2(distfact.x*ScreenSize.z,distfact.y)), offset[i].y);
  431. lenzuv.xy*=offset[i].z;
  432. lenzuv.xy=0.5-lenzuv.xy;//v1
  433. // lenzuv.xy=In.txcoord0.xy-lenzuv.xy;//v2
  434. float3 templenz=tex2D(SamplerBloom2, lenzuv.xy);
  435. templenz=templenz*factors[i];
  436. distfact=(lenzuv.xy-0.5);
  437. distfact*=2.0;
  438. templenz*=saturate(1.0-dot(distfact,distfact));//limit by uv 0..1
  439. // templenz=factors[i] * (1.0-dot(distfact,distfact));
  440. float maxlenz=max(templenz.x, max(templenz.y, templenz.z));
  441. /* float3 tempnor=(templenz.xyz/maxlenz);
  442. tempnor=pow(tempnor, tempF1.z);
  443. templenz.xyz=tempnor.xyz*maxlenz;
  444. */
  445. float tempnor=(maxlenz/(1.0+maxlenz));
  446. tempnor=pow(tempnor, LenzParameters.y);
  447. templenz.xyz*=tempnor;
  448. // templenz*=maxlenz*maxlenz;
  449. lenz+=templenz;
  450. // lenz.xyz=max(lenz.xyz, templenz.xyz*0.99);
  451. }
  452. lenz.xyz*=0.25*LenzParameters.x;
  453. bloom.xyz+=lenz.xyz;
  454. // bloom.w=dot(lenz.xyz, 0.333);
  455. bloom.w=max(lenz.xyz, max(lenz.y, lenz.z));
  456. }
  457. return bloom;
  458. }
  459. //---------------------------------------------------------------------------------
  460. technique BloomPrePass
  461. {
  462. pass p0
  463. {
  464. VertexShader = compile vs_3_0 VS_Bloom();
  465. PixelShader = compile ps_3_0 PS_BloomPrePass();
  466. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  467. CullMode=NONE;
  468. AlphaBlendEnable=FALSE;
  469. AlphaTestEnable=FALSE;
  470. SEPARATEALPHABLENDENABLE=FALSE;
  471. FogEnable=FALSE;
  472. SRGBWRITEENABLE=FALSE;
  473. }
  474. }
  475. technique BloomTexture1
  476. {
  477. pass p0
  478. {
  479. VertexShader = compile vs_3_0 VS_Bloom();
  480. PixelShader = compile ps_3_0 PS_BloomTexture1();
  481. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  482. CullMode=NONE;
  483. AlphaBlendEnable=FALSE;
  484. AlphaTestEnable=FALSE;
  485. SEPARATEALPHABLENDENABLE=FALSE;
  486. FogEnable=FALSE;
  487. SRGBWRITEENABLE=FALSE;
  488. }
  489. }
  490. technique BloomTexture2
  491. {
  492. pass p0
  493. {
  494. VertexShader = compile vs_3_0 VS_Bloom();
  495. PixelShader = compile ps_3_0 PS_BloomTexture2();
  496. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  497. CullMode=NONE;
  498. AlphaBlendEnable=FALSE;
  499. AlphaTestEnable=FALSE;
  500. SEPARATEALPHABLENDENABLE=FALSE;
  501. FogEnable=FALSE;
  502. SRGBWRITEENABLE=FALSE;
  503. }
  504. }
  505. technique BloomPostPass
  506. {
  507. pass p0
  508. {
  509. VertexShader = compile vs_3_0 VS_Bloom();
  510. PixelShader = compile ps_3_0 PS_BloomPostPass();
  511. ColorWriteEnable=ALPHA|RED|GREEN|BLUE;
  512. CullMode=NONE;
  513. AlphaBlendEnable=FALSE;
  514. AlphaTestEnable=FALSE;
  515. SEPARATEALPHABLENDENABLE=FALSE;
  516. FogEnable=FALSE;
  517. SRGBWRITEENABLE=FALSE;
  518. }
  519. #ifdef USE_ANAMFLARE
  520. pass p1
  521. {
  522. AlphaBlendEnable = true;
  523. SrcBlend = One;
  524. DestBlend = One;
  525. PixelShader = compile ps_3_0 PS_ProcessPass_Anamorphic();
  526. }
  527. #endif
  528. }