Skip to content

madblade/brush-renderer

Repository files navigation

Brush renderer

Demo available here!

About

This is an artistic, painterly effect based on particles, running real time on the browser thanks to three.js.

Inspired by Barbara Meier’s seminal Disney paper, “Painterly Rendering for Animation” (SIGGRAPH ’96).

Approach

  1. Generate a static particle set (transparent, max blending).
  2. Render the 3D scene onto a color buffer CB and a (log) depth buffer DB.
  3. Render the 3D scene with a unique material that stores one of the UV components (u or v) onto a buffer UVB.
  4. For each particle (vertex shader):
    • compute the particle color from CB
    • compute the particle size from DB
    • compute G the gradient of UVB (e.g. with a Sobel kernel)
    • compute the particle orientation from G
  5. Rotate particles (fragment shader)

Improvements

  • Sample color on multiple CB values.
  • Render ontop of the pre-rendered scene to remove black holes.
  • Dynamic particle distribution?
  • Better adaptive particle orientations?