Brainstorming/BrushEngine

From MyPaint

Jump to: navigation, search

This page is dedicated to ideas regarding making the brush library.

This is a brainstorming page, a place for new ideas and suggestions.
To contribute, please follow the these guidelines and help us keeping the wiki organized.

Contents

[edit] Refactoring

[edit] Acyclic graph for input/output mapping

Author(s): Lukacu

Current state: At the moment MyPaint brush engine has a lot of parameters to set, some of which are easy to understand and some are not. A lot of flexibility is a good thing, of course, but the problem is that it appears that they are just added when somebody needs them (like speed1, speed2 issue). It is also hard to write some serious documentation this way.

Proposed change: It is a quite big change actually. The idea is that the input values (pressure, tilt, etc.) would be mapped to output parameters (size, opacity, color, etc.) using an acyclic graph of transformations. This approach is used in many graphics applications (e.g. for image filters). It is also very general and extensible, so no more out-of-the-context hacking would be needed.

Pros:

  • General
  • Easy to understand what a brush does (IIRC Python has some nice graph drawing libraries that could represent the brush behavior in a nice way)
  • Powerful (it is hard to imagine what kind of crazy transformations could be done this way)


Cons:

  • A lot of work (more C++ code)
  • A more powerful brush file format needed (XML) - this also means that existing brushes would have to be rewritten. I know this sounds like a deal-breaker but otherwise we are just postponing the inevitable.


[edit] Features

[edit] New input value: direction change

Author(s): Artis Rozentāls

Current state: The elliptical dab parameters provide a good way to create brushes following the stroke direction. However when combined with a low value direction filter for a close, natural tracking sharp curves develop little stars of elliptical dabs at their ends. Slightly increasing the direction filter gives somewhat more visually pleasing effects, but doesn't give a proper line and the default value completely destroys the directional effect.

File:fuzzballs.png

Proposed change: Create a direction change input value that is zero in straight stroke segments and increases when the direction changes, up to 1 for 180 degree turns. It would enable to reduce the elliptical dab ratio and radius on sharp curves, smoothing their tips without sacrificing the directional effect.

I imagine it working somewhat like this: File:direction_change_illustration.png

A direction change multiplier would be necessary to work with elliptical dab ratios that are bigger then 2.0.

Pros:

  • Enables the creation of intuitive and smooth stroking brushes.

Cons:

  • Additional complexity when creating brushes.
  • Possible speed loss due to computing an additional input value.



[edit] Distortion layer

[edit] Invisible layer for painting picture distortions

Author(s): Lucalfons

Current state: New feature, currently not present.

Proposed change: Add a new type of layer that does not modify the colors of pixels but instead moves pixels around, so it distorts the picture, for all layers below it. When figure drawing for example, it should allow moving a leg or making a head smaller without having to erase and redraw previous work. The distortion layer is implemented as a pixel to pixel map that points for every on-screen pixel to any arbitrary pixel in the in-memory picture. Painting in it moves these pointers and causes the visual movement of existing pixels (only for layers below it). Painting in this layer has the effect of dragging the parts of the picture below the brush along with the brush. The distortion layer would come with its own special purpose set of brushes: for moving a region, blowing up a region, shrinking a region, and smoothing of previous distortions.

Pros: Great added value for the artist: permits corrections without redrawing.

Cons: Lots of work to implement, Possibly beyond the scope of this project.


[edit] Normal or Displacement Mapping

[edit] Additional, optional parameter for advanced painting

Author(s): Jude Jackson

Current state: One of the limitations of most digital painting applications is that they do not simulate the texture of paint on canvas or paint on layers of paint. This proposal is to make possible brushes with high complexity but intuitive functionality.

Proposed change: In addition to the regular brush parameters, there is also a texture that defines transformations to the displacement map layer (or normal map, whichever is most appropriate). These can be textured and interact with the the map in all the same ways a regular brush can interact with pixels. While these changes need not be visible is the regular display mode, they can be used to affect the interaction of brushes. For example, using a very light stroke on a paint-style brush might not fill in deep areas, but will easily brush right over the top.

There could also be brushes that do not paint, but only affect the normal/displacement map:

  • Sandpaper(to smooth the texture)
  • Chisel (to create indentations)
  • Embosser (to create indentations upwards)
  • Pinch
  • Inflate
  • Blend

Pros:

  • Enables nuanced effects
  • Can be used by 3D artists to export Normal or Displacement maps for texturing 3D models

Cons:

  • Additional complexity for brushes; may not be used.
  • Computationally expensive
  • Difficult to display
  • Only likely to be used by advanced users


Personal tools