SHARE
TWEET

Improved gauss shader for reshade

a guest Dec 5th, 2015 329 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NAMESPACE_ENTER(CFX)
  2.  
  3. #include CFX_SETTINGS_DEF
  4.  
  5. #if USE_GAUSS
  6.  
  7.  /**
  8.  * Copyright (C) 2012 Jorge Jimenez (jorge@iryoku.com). All rights reserved.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions are met:
  12.  *
  13.  *    1. Redistributions of source code must retain the above copyright notice,
  14.  *       this list of conditions and the following disclaimer.
  15.  *
  16.  *    2. Redistributions in binary form must reproduce the above copyright
  17.  *       notice, this list of conditions and the following disclaimer in the
  18.  *       documentation and/or other materials provided with the distribution.
  19.  *
  20.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
  21.  * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  22.  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  23.  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
  24.  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  25.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  26.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  28.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  29.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  30.  * POSSIBILITY OF SUCH DAMAGE.
  31.  *
  32.  * The views and conclusions contained in the software and documentation are
  33.  * those of the authors and should not be interpreted as representing official
  34.  * policies, either expressed or implied, of the copyright holders.
  35.  */
  36.  
  37. /* This is my attempt to port the the GAUSSIAN shader by Boulotaur2024 to ReShade.
  38.    Some settings from the original are missing and I have added some other settings to achieve certain looks.
  39.    More info can be found at
  40.    http://reshade.me/forum/shader-presentation/27-gaussian-blur-bloom-unsharpmask */
  41.  
  42. /*      External controls of kernel and sample settinsg added by v00d00m4n
  43.         Please, dont forget to add following lines to CustomFX.cfg (or any other config you use).
  44.         Some examples of different blur settings commented, feel free to play with them
  45.         ----
  46. #define KernelSize              3       //Set half of Gauss Kernel Size + 1, because negative values auto-calculated, use formula ((RealKernelSize-1)/2+1)
  47. // use http://dev.theomader.com/gaussian-kernel-calculator/ for 1D kernel calculations,
  48. // but only use values from middle to right, and remember that Kernel size there is actual, not shorten 0-positive half used here!
  49.  
  50. // very good balance
  51. //#define sampleWeightsArray    0.16818994,     0.27276957,     0.11690125,     0.024067905,    0.0021112196
  52. //#define sampleOffsetsArray    0.0,            1.0,            2.0,            3.0,            4.0
  53.  
  54.  
  55. // Default values from previos version of shader, Kernel Size 5
  56. //#define sampleOffsetsArray    0.0,            1.4347826,      3.3478260,      5.2608695,      7.1739130
  57. //#define sampleWeightsArray    0.16818994,     0.27276957,     0.11690125,     0.024067905,    0.0021112196
  58.  
  59. //#define sampleOffsetsArray    0.0,            0.5,            1.0,            1.5,            2.0
  60. //#define sampleWeightsArray    0.2204586031,   0.1899858519,   0.1215916882,   0.0577929595,   0.0204001988
  61.  
  62.  
  63. // Values from http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
  64.  
  65. // Gauss, Kernel Size 5
  66. //#define sampleOffsetsArray    0.0,            1.0,            2.0,            3.0,            4.0//
  67. //#define sampleWeightsArray    0.2270270270,   0.1945945946,   0.1216216216,   0.0540540541,   0.0162162162
  68.  
  69. // Linear, Kernel size 3
  70. #define sampleOffsetsArray      0.0,            1.3846153846,   3.2307692308
  71. #define sampleWeightsArray      0.2270270270,   0.3162162162,   0.0702702703
  72.  
  73. // Linear alt, Kernel size 3
  74. //#define sampleOffsetsArray    0.0,            1.0,            2.0
  75. //#define sampleWeightsArray    0.2270270270,   0.3162162162,   0.0702702703
  76.  
  77.  
  78. //Kernel Size 7
  79. //#define sampleOffsetsArray    0.0,            1.0,            2.0,            3.0,            4.0,            5.0,            6.0
  80. //#define sampleWeightsArray    0.199471,       0.176033,       0.120985,       0.064759,       0.026995,       0.008764,       0.002216
  81.  
  82.  
  83.         ----
  84. */
  85.  
  86. #define CoefLuma_G            float3(0.2126, 0.7152, 0.0722)      // BT.709 & sRBG luma coefficient (Monitors and HD Television)
  87. #define sharp_strength_luma_G (CoefLuma_G * SharpStrength + 0.2)
  88. #define sharp_clampG        0.035
  89.  
  90. texture GBlurTex2Dping{ Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; };
  91. texture GBlurTex2Dpong{ Width = BUFFER_WIDTH; Height = BUFFER_HEIGHT; Format = RGBA8; };
  92.  
  93. sampler2D GBlurSamplerPing { Texture = GBlurTex2Dping; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Clamp; SRGBTexture = FALSE;};
  94. sampler2D GBlurSamplerPong { Texture = GBlurTex2Dpong; MinFilter = Linear; MagFilter = Linear; MipFilter = Linear; AddressU = Clamp; SRGBTexture = FALSE;};
  95.  
  96. float4 HGaussianBlurPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  97. {
  98.  
  99.  
  100.         float sampleOffsets[KernelSize] = { sampleOffsetsArray };
  101.         float sampleWeights[KernelSize] = { sampleWeightsArray };
  102.  
  103.         float4 color = tex2D(RFX_backbufferColor, texcoord) * sampleWeights[0];
  104.         [loop]
  105.         for(int i = 1; i < KernelSize; ++i) {
  106.                 color += tex2D(RFX_backbufferColor, texcoord + float2(sampleOffsets[i] * RFX_pixelSize.x, 0.0)) * sampleWeights[i];
  107.                 color += tex2D(RFX_backbufferColor, texcoord - float2(sampleOffsets[i] * RFX_pixelSize.x, 0.0)) * sampleWeights[i];
  108.         }
  109.        
  110.         return color;
  111. }
  112.  
  113. float4 VGaussianBlurPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  114. {
  115.  
  116.         float sampleOffsets[KernelSize] = { sampleOffsetsArray };
  117.         float sampleWeights[KernelSize] = { sampleWeightsArray };
  118.  
  119.         float4 color = tex2D(GBlurSamplerPing, texcoord) * sampleWeights[0];
  120.         [loop]
  121.         for(int j = 1; j < KernelSize; ++j) {
  122.                 color += tex2D(GBlurSamplerPing, texcoord + float2(0.0f, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  123.                 color += tex2D(GBlurSamplerPing, texcoord - float2(0.0f, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  124.         }
  125.         return color;
  126. }
  127.  
  128. float4 H2GaussianBlurPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  129. {
  130.  
  131.         float sampleOffsets[KernelSize] = { sampleOffsetsArray };
  132.         float sampleWeights[KernelSize] = { sampleWeightsArray };
  133.        
  134.         float4 color = tex2D(GBlurSamplerPong, texcoord) * sampleWeights[0];
  135.         [loop]
  136.         for(int i = 1; i < KernelSize; ++i) {
  137.                 color += tex2D(GBlurSamplerPong, texcoord + float2(sampleOffsets[i] * RFX_pixelSize.x, 0.0)) * sampleWeights[i];
  138.                 color += tex2D(GBlurSamplerPong, texcoord - float2(sampleOffsets[i] * RFX_pixelSize.x, 0.0)) * sampleWeights[i];
  139.         }
  140.         return color;
  141. }
  142.  
  143. float4 V2GaussianBlurPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  144. {
  145.  
  146.         float sampleOffsets[KernelSize] = { sampleOffsetsArray };
  147.         float sampleWeights[KernelSize] = { sampleWeightsArray };
  148.        
  149.         float4 color = tex2D(GBlurSamplerPing, texcoord) * sampleWeights[0];
  150.         [loop]
  151.         for(int j = 1; j < KernelSize; ++j) {
  152.                 color += tex2D(GBlurSamplerPing, texcoord + float2(0.0, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  153.                 color += tex2D(GBlurSamplerPing, texcoord - float2(0.0, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  154.         }
  155.         float4 orig = tex2D(RFX_backbufferColor, texcoord); //Original Image
  156.         #if (USE_Sharpening == 1) // Sharpening
  157.         float3 sharp;
  158.                 sharp = orig.rgb - color.rgb;
  159.                 float sharp_luma1 = dot(sharp, sharp_strength_luma_G);
  160.                 sharp_luma1 = clamp(sharp_luma1, -sharp_clampG, sharp_clampG);
  161.                 orig = orig + sharp_luma1;
  162.         #endif
  163.  
  164.         #if USE_Blur == 1
  165.                 orig = lerp(orig, color, BlurStrength);
  166.         #endif
  167.         return saturate(orig);
  168. }
  169.  
  170. float3 FilmicTonemap(float3 x) {
  171.     float A = 0.15;
  172.     float B = 0.50;
  173.     float C = 0.10;
  174.     float D = 0.20;
  175.     float E = 0.02;
  176.     float F = 0.30;
  177.     float W = 11.2;
  178.     return ((x*(A*x+C*B)+D*E) / (x*(A*x+B)+D*F))- E / F;
  179. }
  180.  
  181. float3 DoToneMap(float3 color) {
  182.         /*
  183.     #if TONEMAP_OPERATOR == 1 //TONEMAP_LINEAR
  184.     return exposure * color;
  185.     #elif TONEMAP_OPERATOR == 2 //TONEMAP_EXPONENTIAL
  186.     color = 1.0 - exp2(-exposure * color);
  187.     return color;
  188.     #elif TONEMAP_OPERATOR == 3 //TONEMAP_EXPONENTIAL_HSV
  189.     color = rgb2hsv(color);
  190.     color.b = 1.0 - exp2(-exposure * color.b);
  191.     color = hsv2rgb(color);
  192.     return color;
  193.     #elif TONEMAP_OPERATOR == 5 //TONEMAP_REINHARD
  194.     color = xyz2Yxy(rgb2xyz(color));
  195.     float L = color.r;
  196.     L *= exposure;
  197.     float LL = 1 + L / (burnout * burnout);
  198.     float L_d = L * LL / (1 + L);
  199.     color.r = L_d;
  200.     color = xyz2rgb(Yxy2xyz(color));
  201.     return color;
  202.     #else // TONEMAP_FILMIC
  203.         */
  204.     color = 2.0f * FilmicTonemap(2.00 * color);
  205.     float3 whiteScale = 1.0f / FilmicTonemap(11.2);
  206.     color *= whiteScale;
  207.     return color;
  208. }
  209.  
  210. float4 GlareDetectionPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  211. {
  212.  
  213.     float2 offsets[5] = {
  214.         float2( 0.0,  0.0),
  215.         float2(-1.0,  0.0),
  216.         float2( 1.0,  0.0),
  217.         float2( 0.0, -1.0),
  218.         float2( 0.0,  1.0),
  219.     };
  220.         float4 color;
  221.     //float4 color = 1e100;
  222.     for (int i = 0; i < 5; i++)
  223.         color = tex2D(RFX_backbufferColor,  texcoord + offsets[i] * RFX_pixelSize), color;
  224.                 #if (USE_Bloom == 1)   
  225.                         color.rgb *= GaussExposure;
  226.                 #endif
  227.  
  228.         #if (USE_Bloom == 1)
  229.                 color = float4(max(color.rgb - GaussThreshold / (1.0 - GaussThreshold), 0.0), color.a);
  230.         #endif
  231.         return color;
  232. }
  233.  
  234. float4 FinalBloomPS(in float4 pos : SV_Position, in float2 texcoord : TEXCOORD) : COLOR
  235. {
  236.  
  237.         float sampleOffsets[5] = { 0.0, 1.4347826, 3.3478260, 5.2608695, 7.1739130 };
  238.         float sampleWeights[5] = { 0.16818994, 0.27276957, 0.11690125, 0.024067905, 0.0021112196 };
  239.        
  240.         float4 color = tex2D(GBlurSamplerPing, texcoord) * sampleWeights[0];
  241.         [loop]
  242.         for(int j = 1; j < 5; ++j) {
  243.                 color += tex2D(GBlurSamplerPing, texcoord + float2(0.0, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  244.                 color += tex2D(GBlurSamplerPing, texcoord - float2(0.0, sampleOffsets[j] * RFX_pixelSize.y)) * sampleWeights[j];
  245.         }
  246.         float4 orig = tex2D(RFX_backbufferColor, texcoord); //Original Image
  247.                         color.rgb = DoToneMap(color.rgb) * float3(BloomRed, BloomGreen, BloomBlue);
  248.                         #if (GaussBloomWarmth == 0)
  249.                                 orig = lerp(orig, color, BloomStrength);                                        // Neutral
  250.                         #elif (GaussBloomWarmth == 1)
  251.                                 orig = lerp(orig, max(orig + (color *1.6) - 1.0, 0.0), BloomStrength);          // Warm and cheap
  252.                         #else
  253.                                 orig = lerp(orig, (1.0 - ((1.0 - orig) * (1.0 - color *1.0))), BloomStrength);  // Foggy bloom
  254.                         #endif
  255.                         /*      // Bloom
  256.                 #if (GaussBloomWarmth == 0)
  257.                         orig = lerp(orig, color *4, BloomStrength);                                     // Neutral
  258.                 #elif (GaussBloomWarmth == 1)
  259.                         orig = lerp(orig, max(orig *1.8 + (color *5) - 1.0, 0.0), BloomStrength);       // Warm and cheap
  260.                 #else
  261.                         orig = lerp(orig, (1.0 - ((1.0 - orig) * (1.0 - color *1.0))), BloomStrength);  // Foggy bloom
  262.                 #endif */
  263.                
  264.         return saturate(orig);
  265. }
  266.  
  267. technique Gaussian_Tech <bool enabled = RFX_Start_Enabled; int toggle = Gaussian_ToggleKey; >
  268. {
  269. #if USE_Sharpening == 1 || USE_Blur == 1
  270.  
  271.         pass H1
  272.         {
  273.                 VertexShader = RFX_VS_PostProcess;
  274.                 PixelShader = HGaussianBlurPS;
  275.                 RenderTarget = GBlurTex2Dping;
  276.         }
  277.  
  278. #if GaussQuality == 1 || GaussQuality == 2 || GaussQuality == 3 || GaussQuality == 4 || GaussQuality == 5 ||  GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12
  279.         pass V1
  280.         {
  281.                 VertexShader = RFX_VS_PostProcess;
  282.                 PixelShader = VGaussianBlurPS;
  283.                 RenderTarget = GBlurTex2Dpong;
  284.         }
  285.        
  286.         pass H2
  287.         {
  288.                 VertexShader = RFX_VS_PostProcess;
  289.                 PixelShader = H2GaussianBlurPS;
  290.                 RenderTarget = GBlurTex2Dping;
  291.         }
  292. #endif 
  293. #if GaussQuality == 2 || GaussQuality == 3 || GaussQuality == 4 || GaussQuality == 5 ||  GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12
  294.         pass V2
  295.         {
  296.                 VertexShader = RFX_VS_PostProcess;
  297.                 PixelShader = VGaussianBlurPS;
  298.                 RenderTarget = GBlurTex2Dpong;
  299.         }
  300.        
  301.         pass H3
  302.         {
  303.                 VertexShader = RFX_VS_PostProcess;
  304.                 PixelShader = H2GaussianBlurPS;
  305.                 RenderTarget = GBlurTex2Dping;
  306.         }
  307. #endif 
  308. #if GaussQuality == 3 || GaussQuality == 4 || GaussQuality == 5 ||  GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12 
  309.         pass V3
  310.         {
  311.                 VertexShader = RFX_VS_PostProcess;
  312.                 PixelShader = VGaussianBlurPS;
  313.                 RenderTarget = GBlurTex2Dpong;
  314.         }
  315.                
  316.         pass H4
  317.         {
  318.                 VertexShader = RFX_VS_PostProcess;
  319.                 PixelShader = H2GaussianBlurPS;
  320.                 RenderTarget = GBlurTex2Dping;
  321.         }
  322. #endif 
  323. #if GaussQuality == 4 || GaussQuality == 5 ||  GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12      
  324.         pass V4
  325.         {
  326.                 VertexShader = RFX_VS_PostProcess;
  327.                 PixelShader = VGaussianBlurPS;
  328.                 RenderTarget = GBlurTex2Dpong;
  329.         }      
  330.        
  331.         pass H5
  332.         {
  333.                 VertexShader = RFX_VS_PostProcess;
  334.                 PixelShader = H2GaussianBlurPS;
  335.                 RenderTarget = GBlurTex2Dping;
  336.         }
  337. #endif 
  338. #if GaussQuality == 5 ||  GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12   
  339.         pass V5
  340.         {
  341.                 VertexShader = RFX_VS_PostProcess;
  342.                 PixelShader = VGaussianBlurPS;
  343.                 RenderTarget = GBlurTex2Dpong;
  344.         }
  345.        
  346.         pass H6
  347.         {
  348.                 VertexShader = RFX_VS_PostProcess;
  349.                 PixelShader = H2GaussianBlurPS;
  350.                 RenderTarget = GBlurTex2Dping;
  351.         }
  352. #endif 
  353. #if GaussQuality == 6 || GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12 
  354.         pass V6
  355.         {
  356.                 VertexShader = RFX_VS_PostProcess;
  357.                 PixelShader = VGaussianBlurPS;
  358.                 RenderTarget = GBlurTex2Dpong;
  359.         }
  360.        
  361.         pass H7
  362.         {
  363.                 VertexShader = RFX_VS_PostProcess;
  364.                 PixelShader = H2GaussianBlurPS;
  365.                 RenderTarget = GBlurTex2Dping;
  366.         }
  367. #endif 
  368. #if GaussQuality == 7 || GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12      
  369.         pass V7
  370.         {
  371.                 VertexShader = RFX_VS_PostProcess;
  372.                 PixelShader = VGaussianBlurPS;
  373.                 RenderTarget = GBlurTex2Dpong;
  374.         }
  375.        
  376.         pass H8
  377.         {
  378.                 VertexShader = RFX_VS_PostProcess;
  379.                 PixelShader = H2GaussianBlurPS;
  380.                 RenderTarget = GBlurTex2Dping;
  381.         }
  382. #endif 
  383. #if GaussQuality == 8 || GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12   
  384.         pass V8
  385.         {
  386.                 VertexShader = RFX_VS_PostProcess;
  387.                 PixelShader = VGaussianBlurPS;
  388.                 RenderTarget = GBlurTex2Dpong;
  389.         }
  390.        
  391.         pass H9
  392.         {
  393.                 VertexShader = RFX_VS_PostProcess;
  394.                 PixelShader = H2GaussianBlurPS;
  395.                 RenderTarget = GBlurTex2Dping;
  396.         }
  397. #endif 
  398. #if GaussQuality == 9 || GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12
  399.         pass V9
  400.         {
  401.                 VertexShader = RFX_VS_PostProcess;
  402.                 PixelShader = VGaussianBlurPS;
  403.                 RenderTarget = GBlurTex2Dpong;
  404.         }
  405.        
  406.         pass H10
  407.         {
  408.                 VertexShader = RFX_VS_PostProcess;
  409.                 PixelShader = H2GaussianBlurPS;
  410.                 RenderTarget = GBlurTex2Dping;
  411.         }
  412. #endif 
  413. #if GaussQuality == 10 || GaussQuality == 11 || GaussQuality == 12     
  414.         pass V10
  415.         {
  416.                 VertexShader = RFX_VS_PostProcess;
  417.                 PixelShader = VGaussianBlurPS;
  418.                 RenderTarget = GBlurTex2Dpong;
  419.         }
  420.        
  421.         pass H11
  422.         {
  423.                 VertexShader = RFX_VS_PostProcess;
  424.                 PixelShader = H2GaussianBlurPS;
  425.                 RenderTarget = GBlurTex2Dping;
  426.         }
  427. #endif 
  428. #if GaussQuality == 11 || GaussQuality == 12   
  429.         pass V11
  430.         {
  431.                 VertexShader = RFX_VS_PostProcess;
  432.                 PixelShader = VGaussianBlurPS;
  433.                 RenderTarget = GBlurTex2Dpong;
  434.         }
  435.        
  436.         pass H12
  437.         {
  438.                 VertexShader = RFX_VS_PostProcess;
  439.                 PixelShader = H2GaussianBlurPS;
  440.                 RenderTarget = GBlurTex2Dping;
  441.         }
  442. #endif 
  443. #if GaussQuality == 12
  444.         pass V12
  445.         {
  446.                 VertexShader = RFX_VS_PostProcess;
  447.                 PixelShader = VGaussianBlurPS;
  448.                 RenderTarget = GBlurTex2Dpong;
  449.         }
  450.        
  451.         pass H13
  452.         {
  453.                 VertexShader = RFX_VS_PostProcess;
  454.                 PixelShader = H2GaussianBlurPS;
  455.                 RenderTarget = GBlurTex2Dping;
  456.         }
  457. #endif
  458.         pass VFinal
  459.         {
  460.                 VertexShader = RFX_VS_PostProcess;
  461.                 PixelShader = V2GaussianBlurPS;
  462.         }
  463. #endif
  464. #if USE_Bloom == 1
  465.  
  466.         pass GD
  467.         {
  468.                 VertexShader = RFX_VS_PostProcess;
  469.                 PixelShader = GlareDetectionPS;
  470.                 RenderTarget = GBlurTex2Dpong;
  471.         }
  472.        
  473.         pass H1Bloom
  474.         {
  475.                 VertexShader = RFX_VS_PostProcess;
  476.                 PixelShader = H2GaussianBlurPS;
  477.                 RenderTarget = GBlurTex2Dping;
  478.         }
  479.                
  480. #if GaussBloomQuality == 1 || GaussBloomQuality == 2 || GaussBloomQuality == 3 || GaussBloomQuality == 4 || GaussBloomQuality == 5 ||  GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12
  481.         pass V1
  482.         {
  483.                 VertexShader = RFX_VS_PostProcess;
  484.                 PixelShader = VGaussianBlurPS;
  485.                 RenderTarget = GBlurTex2Dpong;
  486.         }
  487.        
  488.         pass H2
  489.         {
  490.                 VertexShader = RFX_VS_PostProcess;
  491.                 PixelShader = H2GaussianBlurPS;
  492.                 RenderTarget = GBlurTex2Dping;
  493.         }
  494. #endif 
  495. #if GaussBloomQuality == 2 || GaussBloomQuality == 3 || GaussBloomQuality == 4 || GaussBloomQuality == 5 ||  GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12
  496.         pass V2
  497.         {
  498.                 VertexShader = RFX_VS_PostProcess;
  499.                 PixelShader = VGaussianBlurPS;
  500.                 RenderTarget = GBlurTex2Dpong;
  501.         }
  502.        
  503.         pass H3
  504.         {
  505.                 VertexShader = RFX_VS_PostProcess;
  506.                 PixelShader = H2GaussianBlurPS;
  507.                 RenderTarget = GBlurTex2Dping;
  508.         }
  509. #endif 
  510. #if GaussBloomQuality == 3 || GaussBloomQuality == 4 || GaussBloomQuality == 5 ||  GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12       
  511.         pass V3
  512.         {
  513.                 VertexShader = RFX_VS_PostProcess;
  514.                 PixelShader = VGaussianBlurPS;
  515.                 RenderTarget = GBlurTex2Dpong;
  516.         }
  517.                
  518.         pass H4
  519.         {
  520.                 VertexShader = RFX_VS_PostProcess;
  521.                 PixelShader = H2GaussianBlurPS;
  522.                 RenderTarget = GBlurTex2Dping;
  523.         }
  524. #endif 
  525. #if GaussBloomQuality == 4 || GaussBloomQuality == 5 ||  GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12 
  526.         pass V4
  527.         {
  528.                 VertexShader = RFX_VS_PostProcess;
  529.                 PixelShader = VGaussianBlurPS;
  530.                 RenderTarget = GBlurTex2Dpong;
  531.         }      
  532.        
  533.         pass H5
  534.         {
  535.                 VertexShader = RFX_VS_PostProcess;
  536.                 PixelShader = H2GaussianBlurPS;
  537.                 RenderTarget = GBlurTex2Dping;
  538.         }
  539. #endif 
  540. #if GaussBloomQuality == 5 ||  GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12   
  541.         pass V5
  542.         {
  543.                 VertexShader = RFX_VS_PostProcess;
  544.                 PixelShader = VGaussianBlurPS;
  545.                 RenderTarget = GBlurTex2Dpong;
  546.         }
  547.        
  548.         pass H6
  549.         {
  550.                 VertexShader = RFX_VS_PostProcess;
  551.                 PixelShader = H2GaussianBlurPS;
  552.                 RenderTarget = GBlurTex2Dping;
  553.         }
  554. #endif 
  555. #if GaussBloomQuality == 6 || GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12      
  556.         pass V6
  557.         {
  558.                 VertexShader = RFX_VS_PostProcess;
  559.                 PixelShader = VGaussianBlurPS;
  560.                 RenderTarget = GBlurTex2Dpong;
  561.         }
  562.        
  563.         pass H7
  564.         {
  565.                 VertexShader = RFX_VS_PostProcess;
  566.                 PixelShader = H2GaussianBlurPS;
  567.                 RenderTarget = GBlurTex2Dping;
  568.         }
  569. #endif 
  570. #if GaussBloomQuality == 7 || GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12
  571.         pass V7
  572.         {
  573.                 VertexShader = RFX_VS_PostProcess;
  574.                 PixelShader = VGaussianBlurPS;
  575.                 RenderTarget = GBlurTex2Dpong;
  576.         }
  577.        
  578.         pass H8
  579.         {
  580.                 VertexShader = RFX_VS_PostProcess;
  581.                 PixelShader = H2GaussianBlurPS;
  582.                 RenderTarget = GBlurTex2Dping;
  583.         }
  584. #endif 
  585. #if GaussBloomQuality == 8 || GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12  
  586.         pass V8
  587.         {
  588.                 VertexShader = RFX_VS_PostProcess;
  589.                 PixelShader = VGaussianBlurPS;
  590.                 RenderTarget = GBlurTex2Dpong;
  591.         }
  592.        
  593.         pass H9
  594.         {
  595.                 VertexShader = RFX_VS_PostProcess;
  596.                 PixelShader = H2GaussianBlurPS;
  597.                 RenderTarget = GBlurTex2Dping;
  598.         }
  599. #endif 
  600. #if GaussBloomQuality == 9 || GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12
  601.         pass V9
  602.         {
  603.                 VertexShader = RFX_VS_PostProcess;
  604.                 PixelShader = VGaussianBlurPS;
  605.                 RenderTarget = GBlurTex2Dpong;
  606.         }
  607.        
  608.         pass H10
  609.         {
  610.                 VertexShader = RFX_VS_PostProcess;
  611.                 PixelShader = H2GaussianBlurPS;
  612.                 RenderTarget = GBlurTex2Dping;
  613.         }
  614. #endif 
  615. #if GaussBloomQuality == 10 || GaussBloomQuality == 11 || GaussBloomQuality == 12      
  616.         pass V10
  617.         {
  618.                 VertexShader = RFX_VS_PostProcess;
  619.                 PixelShader = VGaussianBlurPS;
  620.                 RenderTarget = GBlurTex2Dpong;
  621.         }
  622.        
  623.         pass H11
  624.         {
  625.                 VertexShader = RFX_VS_PostProcess;
  626.                 PixelShader = H2GaussianBlurPS;
  627.                 RenderTarget = GBlurTex2Dping;
  628.         }
  629. #endif 
  630. #if GaussBloomQuality == 11 || GaussBloomQuality == 12 
  631.         pass V11
  632.         {
  633.                 VertexShader = RFX_VS_PostProcess;
  634.                 PixelShader = VGaussianBlurPS;
  635.                 RenderTarget = GBlurTex2Dpong;
  636.         }
  637.        
  638.         pass H12
  639.         {
  640.                 VertexShader = RFX_VS_PostProcess;
  641.                 PixelShader = H2GaussianBlurPS;
  642.                 RenderTarget = GBlurTex2Dping;
  643.         }
  644. #endif 
  645. #if GaussBloomQuality == 12
  646.         pass V12
  647.         {
  648.                 VertexShader = RFX_VS_PostProcess;
  649.                 PixelShader = VGaussianBlurPS;
  650.                 RenderTarget = GBlurTex2Dpong;
  651.         }
  652.        
  653.         pass H13
  654.         {
  655.                 VertexShader = RFX_VS_PostProcess;
  656.                 PixelShader = H2GaussianBlurPS;
  657.                 RenderTarget = GBlurTex2Dping;
  658.         }
  659. #endif
  660.        
  661.         pass VFinal
  662.         {
  663.                 VertexShader = RFX_VS_PostProcess;
  664.                 PixelShader = FinalBloomPS;
  665.                 //RenderTarget = GBlurTex2Dpong;
  666.                 //RenderTarget = frameTex2D;
  667.         }
  668. #endif
  669. }
  670.  
  671. #endif
  672.  
  673. #include CFX_SETTINGS_UNDEF
  674.  
  675. NAMESPACE_LEAVE()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top