Coder Social home page Coder Social logo

bluenoisegenerator's Introduction

BlueNoiseGenerator

This is my attempt of an implementation of a Siggraph 2016 paper "Blue-noise Dithered Sampling" by Iliyan Georgiev and Marcos Fajardo from Solid Angle. You can find the link to the paper abstract here: https://www.solidangle.com/research/dither_abstract.pdf

Motivation

Main motivation for using blue noise is avoiding "clumping" of noise and by using only high frequency of signal, getting perceptually better sample distribution. Blue noise can be used for dithering, offsetting samples, covering space (for example uniform disk sampling).

Mikkel Gjol and Mikken Svendsen from Playdead have shown some excellent examples of its use in their GDC presentation "Low complexity, high fidelity - rendering of INSIDE": http://www.gdcvault.com/play/1023002/Low-Complexity-High-Fidelity-INSIDE http://f0716f2bff707a1b9e85-36c178e006d3d30c5b9c8dd905f8236a.r70.cf2.rackcdn.com/rendering_inside.pdf

Implementation

Implementation is pretty straightforward implementation of the Siggraph 2016 paper with my attempts to make it "generalized" for more dimensions and larger vector values. More than 2 dimenstions are useful for either volumetric effects, or treating time as next, 3rd or 4th dimension. Vectors of variables can be used for things like vectors of many independent random variables (radius and angle in polar coordinates). NOTE: I tested so far only 2 and 3 dimensions. :)

It's implemented in standard C++ style, without any extravaganza. Single file, compile it with clang or MSVS as a console app.

Also added a Mathematica helper visualization notebook https://github.com/bartwronski/BlueNoiseGenerator/blob/master/blue_noise.nb

Results

Given some 16 by 16 intial distribution:

Image

With following white-noise-like Fourier distribution:

Image

Algorithm generates following pattern:

Image

With following Fourier distribution (less low frequencies):

Image

It works great under repetition / tiling!

Image

Here is an example of it working on a 2D vector:

Image

Slice 1 of this vector:

Image

Slice 2 of this vector:

Image

Slightly more clumpy, but still pretty decent, here is Fourier of 1st slice and the whole image:

Image

Image

TODO

Support different sized of different dimensions sizes (for example for 3D noise having less depth slices).

bluenoisegenerator's People

Contributors

bartwronski avatar nicovize avatar pixelmager avatar currenttv 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.