Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DepthOfFieldEffect"/> class.
 /// </summary>
 public DepthOfFieldEffect(GraphicsDevice graphics)
 {
     Material = combine = new DepthOfFieldMaterial(graphics);
     Passes.Add(new PostEffectChain(TextureUsage.Blur,
                                    depthScaleEffect = new PostEffect()
     {
         Material = depthScale = new DepthOfFieldMaterial(graphics)
         {
             IsDownScale = true
         }, RenderTargetScale = 0.5f
     },
                                    scaleEffect = new PostEffect()
     {
         Material = new ScaleMaterial(graphics), RenderTargetScale = 0.5f, Enabled = false
     },
                                    blur = new BlurEffect(graphics)
     {
         DepthBufferEnabled = true
     },
                                    new PostEffect()
     {
         Material = new ScaleMaterial(graphics), RenderTargetScale = 2.0f
     }
                                    ));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HighDynamicRangeEffect"/> class.
 /// </summary>
 public HighDynamicRangeEffect(GraphicsDevice graphics)
 {
     Material = toneMapping = new ToneMappingMaterial(graphics);
     Passes.Add(new PostEffectChain(TextureUsage.Bloom,
                                    new PostEffect()
     {
         Material = threshold = new ThresholdMaterial(graphics), RenderTargetScale = 0.5f, SurfaceFormat = SurfaceFormat.Color
     },
                                    blur = new BlurEffect(graphics),
                                    new PostEffect()
     {
         Material = new ScaleMaterial(graphics), RenderTargetScale = 2.0f
     }
                                    ));
     Passes.Add(luminanceChain = new LuminanceChain(graphics));
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BloomEffect"/> class.
 /// </summary>
 public BloomEffect(GraphicsDevice graphics)
 {
     Material = bloom = new BloomMaterial(graphics);
     Passes.Add(new PostEffectChain());
     Passes.Add(new PostEffectChain(TextureUsage.Bloom,
                                    new PostEffect()
     {
         Material = threshold = new ThresholdMaterial(graphics), RenderTargetScale = 0.5f, SurfaceFormat = SurfaceFormat.Color
     },
                                    blur = new BlurEffect(graphics),
                                    new PostEffect()
     {
         Material = new ScaleMaterial(graphics), RenderTargetScale = 2.0f
     }
                                    ));
 }