/// <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>(); }
protected override void InitializeCore() { base.InitializeCore(); effectFirstPass = ToLoadAndUnload(new ImageEffectShader("DepthMinMaxEffect")); effectNotFirstPass = ToLoadAndUnload(new ImageEffectShader("DepthMinMaxEffect")); readback = ToLoadAndUnload(new ImageReadback <Vector2>()); }
protected override void InitializeCore() { base.InitializeCore(); coclinearDepthMapEffect = ToLoadAndUnload(new ImageEffectShader("CoCLinearDepthShader")); combineLevelsEffect = ToLoadAndUnload(new ImageEffectShader("CombineLevelsFromCoCEffect")); combineLevelsFrontEffect = ToLoadAndUnload(new ImageEffectShader("CombineFrontCoCEffect")); combineLevelsFrontEffect.BlendState = BlendStates.AlphaBlend; textureScaler = ToLoadAndUnload(new ImageScaler(SamplingPattern.Expanded)); 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); }
protected override void InitializeCore() { base.InitializeCore(); LuminanceLogEffect = ToLoadAndUnload(new LuminanceLogEffect()); // Create 1x1 texture AverageLuminanceTexture = 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; }