Exemplo n.º 1
0
        protected override void InitializeCore()
        {
            base.InitializeCore();

            effect   = ToLoadAndUnload(new ImageEffectShader("DepthMinMaxEffect"));
            readback = ToLoadAndUnload(new ImageReadback <Vector2>(Context));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LuminanceEffect" /> class.
 /// </summary>
 public LuminanceEffect()
 {
     LuminanceFormat = PixelFormat.R16_Float;
     DownscaleCount  = 6;
     UpscaleCount    = 4;
     EnableAverageLuminanceReadback = true;
     readback = new ImageReadback <Half>();
 }
Exemplo n.º 3
0
        protected override void InitializeCore()
        {
            base.InitializeCore();

            coclinearDepthMapEffect  = ToLoadAndUnload(new ImageEffectShader("CoCLinearDepthShader"));
            combineLevelsEffect      = ToLoadAndUnload(new ImageEffectShader("CombineLevelsFromCoCEffect"));
            combineLevelsFrontEffect = ToLoadAndUnload(new ImageEffectShader("CombineFrontCoCEffect"));
            textureScaler            = ToLoadAndUnload(new ImageScaler());
            cocMapBlur             = ToLoadAndUnload(new CoCMapBlur());
            thresholdAlphaCoC      = ToLoadAndUnload(new ImageEffectShader("ThresholdAlphaCoC"));
            thresholdAlphaCoCFront = ToLoadAndUnload(new ImageEffectShader("ThresholdAlphaCoCFront"));
            pointDepthShader       = ToLoadAndUnload(new ImageEffectShader("PointDepth"));
            depthReadBack          = ToLoadAndUnload(new ImageReadback <Half>());
            depthCenter1x1         = Texture.New2D(GraphicsDevice, 1, 1, 1, PixelFormat.R16_Float, TextureFlags.ShaderResource | TextureFlags.RenderTarget).DisposeBy(this);
        }
Exemplo n.º 4
0
        protected override void InitializeCore()
        {
            base.InitializeCore();

            LuminanceLogEffect = ToLoadAndUnload(new LuminanceLogEffect());

            // Create 1x1 texture
            luminance1x1 = Texture.New2D(GraphicsDevice, 1, 1, 1, luminanceFormat, TextureFlags.ShaderResource | TextureFlags.RenderTarget).DisposeBy(this);

            // Use a multiscaler
            multiScaler = ToLoadAndUnload(new ImageMultiScaler());

            // Readback is always going to be done on the 1x1 texture
            readback = ToLoadAndUnload(readback);

            // Blur used before upscaling
            blur        = ToLoadAndUnload(new GaussianBlur());
            blur.Radius = 4;
        }