// Set blur parameters to effect
 void SetParameters(GaussianBlurDirection Direction)
 {
     if (Direction == GaussianBlurDirection.Horizontal)
     {
         gblur.Parameters["sampleWeights"].SetValue(sampleWeightsH);
         gblur.Parameters["sampleOffsets"].SetValue(sampleOffsetsH);
     }
     else
     {
         gblur.Parameters["sampleWeights"].SetValue(sampleWeightsV);
         gblur.Parameters["sampleOffsets"].SetValue(sampleOffsetsV);
     }
 }
 // Set blur parameters to effect
 void SetParameters(GaussianBlurDirection Direction)
 {
     if (Direction == GaussianBlurDirection.Horizontal)
     {
         gblur.Parameters["sampleWeights"].SetValue(sampleWeightsH);
         gblur.Parameters["sampleOffsets"].SetValue(sampleOffsetsH);
     }
     else
     {
         gblur.Parameters["sampleWeights"].SetValue(sampleWeightsV);
         gblur.Parameters["sampleOffsets"].SetValue(sampleOffsetsV);
     }
 }
Exemplo n.º 3
0
 // Applies post processor to texture in specified direction
 public void Draw(GaussianBlurDirection Direction, Texture2D Input)
 {
     this.Input = Input;
     SetParameters(Direction);
     base.Draw();
 }
Exemplo n.º 4
0
 void SetParameters(GaussianBlurDirection Direction)
 {
     if (Direction == GaussianBlurDirection.Horizontal)
     {
         Effect.Parameters["sampleWeights"].SetValue(sampleWeightsH);
         Effect.Parameters["sampleOffsets"].SetValue(sampleOffsetsH);
     }
     else if (Direction == GaussianBlurDirection.Vertical)
     {
         Effect.Parameters["sampleWeights"].SetValue(sampleWeightsV);
         Effect.Parameters["sampleOffsets"].SetValue(sampleOffsetsV);
     }
 }