Project

General

Profile

Feature #8

Add support for new types of Regions

Added by Distorted Admin over 8 years ago. Updated almost 5 years ago.

Status:
New
Priority:
Normal
Start date:
06/03/2016
Due date:
% Done:

20%

Estimated time:

Description

Currently the library only supports masking the area on which a given effect works by a circular region.

Explore possibilities to extend this to other types of shapes like rectangles or at least ellipses.

History

#1

Updated by Leszek Koltunski about 8 years ago

Proposed improvements:

Completely decouple the Region from the Effect. Provide possibility to set up 'Masks' which, for every point on the Object, return a float describing the 'strength degree' the effect has on this very point.

Current implementation has this fixed: one can define a circle and a point (called the center of effect) and then the 'strength degree' is 1 in the center, linearly going to 0 towards the borders of the circle, and stays 0 outside.

Some effects also cut off the 'strength' at Object boundary (DISTORT) others don't (DEFORM).

The 'MASK' would make all of this generically adjustable for all effects:

1) define if we cut off the effect at:
a) only Region boundaries
b) common part of the Region and Object
c) only Object
d) never (i.e. Mask switched off and 'degree strength' 1 everywhere)
2) define a 'Region' (circle as now, but probably defined with absolute coordinates of the center of the circle, and not as a offset vector from the center of the effect)
3) define a pair of 'translation' functions which would translate the linear (-infinity, 1) 'degree' as returned by the 'degree' functions to actual 'strength degree'.
The first of those functions, F1, would be responsible for translating values outside of the Region (negative degrees), the second, F2 - inside (the (0,1) degrees).

In order to do 3) above, we'd first need to rewrite the 'degree_region' and 'degree_bitmap' so that they return (negative) degrees when point is outside the (respectively) Region or Object, and not like now - cut off outside and always return 0.

Currently the 'translation pair' is - in Vertex effects - implicitly fixed at: F1 = 0, F2 = x; in case of Fragment effects, we have F1=0, and F2=x or 1 depending on if the effect is 'smooth'.

#2

Updated by Distorted Admin almost 5 years ago

  • Assignee set to Leszek Koltunski
  • % Done changed from 0 to 20

Partly done - we have decoupled the Region.

#3

Updated by Distorted Admin almost 5 years ago

Idea for a new Region: a five dimensional 3D 'strip'. Definition:

1) a 3D plane ax+by+cz=d
2) a distance 'e'

Then to return a degree:

- compute distance 'E' a given point is from the plane
- return max(0, 1-E/e)

Also available in: Atom PDF