Giter Club home page Giter Club logo

gaussianblurgroupshared's Introduction

GaussianBlurGroupShared

Gaussian blur

This is a Gaussian blur implementation I wrote in HLSL, as a compute shader in Unity.

It uses groupshared memory, which might speed up the processing. I haven't had yet time to benchmark it against exact same blur without the groupshared memory implementation. Anyway, groupshared memory was the main focus of this as a learning experience/study case and this is not obviously intended for production use.

Using groupshared memory requires some thinking and makes it a bit tricker to implement things, as one needs to fit the data to a quite small memory space (16kb per group.) So in practice this sets some limits/requirements how you can access the data (when you do things like blurs, edge finding etc.) You probably have to do things in tiles or lines and then store the edge padding too (blur radius in this case.)

Features

  • This test setup has just a simple scene and you can adjust the parameters in the Inspector
  • You can select an image to test the Gaussian blur on
  • Processed image is blitted to the screen
  • Blur settings are shown on screen
  • Blur kernel size can be adjusted in the Inspector
  • I implemented this Gaussian blur as separable (x and y dimensions rendered in separate steps which reduces the rendering cost considerably.)

Notes

  • Built in Unity 2018.4, most likely works on later versions
  • This implementation assumes a square image

© 2020 Olli Sorjonen All Rights Reserved

gaussianblurgroupshared's People

Contributors

o-l-l-i avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.