BloomRenderPipeline as PCL

Hi there!

Yesterday I was discussing with @Jjagg how it would be nice to have small reusable parts that one could load when designing a game.
So here we are.

github: https://github.com/UnterrainerInformatik/BloomEffectRenderer
nuget: https://www.nuget.org/packages/BloomEffectRenderer/

This render-pipeline renders a bloom effect using the old XNA technique in the old blog posts (reference is in the readme) but without all the hassle.
Just get the package via nuget and start blooming :slight_smile:
The shaders are embedded, so you don’t even have to add them to the content pipeline.

Should be easy to use:

private Point Resolution { get; } = new Point(1920, 1080);
private Renderer Renderer { get; } = new Renderer();

protected override void LoadContent()
{
  ...
  Renderer.LoadContent(GraphicsDevice);
  ...
}

protected override void UnloadContent()
{
  ...
  Renderer?.UnloadContent();
  ...
}

protected override void Initialize()
{
  base.Initialize();
  Renderer.Initialize(graphics.GraphicsDevice, Resolution);
}

protected override void Draw(GameTime gameTime)
{
  // Image is some Texture2D that will be drawn to the backbuffer in this example.
  // (hence the <null>).
  // To bloom your game in a post-process step, draw all your assets to a
  // RenderTarget2D first and then pass that rendertarget to this method.
  Renderer.Render(graphics.GraphicsDevice, spriteBatch, "image", Image, null, Settings.PRESET_SETTINGS[1]);
  base.Draw(gameTime);
}

As always, if you have suggestions or find bugs, I’m open to pull requests / discussions here or on GitHub, no problem.
Or PM me.

cu,
Psilo

5 Likes

you could had more effects :slight_smile:

1 Like

Hey @procfxgen!
Nice project you have there. Already checked it out some time ago. Like it.

The purpose of this project was to give people a tested, cross-platform, cross shader-model, no-shader ‘installation’ hassle-free MonoGame implementation of that particular shader in a nice-to-import nuget package, a nice readme.md with visual examples and a nice demo-project on github to play around with.

Anything more fancy and I think it would over-complicate the project (for example it has just some pixel-shaders as of now and no vertex-shaders at all).

But if you feel like you could use some of the stuff I use in my project then just take what you need.
If you feel we should merge stuff, I think that’s a lot of work, but a nice task we should coordinate.
cu