-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
If a patch's output content type matches the content type of one of its inputs, it's considered a filter, and will automatically be inserted upstream of other patches that use the same content type.
For example, 'Ripple' is a filter, because it takes a U/V coordinate as input, and returns a U/V coordinate:
uniform float time;
uniform float rippleAmount; // @type float
// @return uv-coordinate
// @param uvIn uv-coordinate
vec2 main(vec2 uvIn) {
vec2 p = -1.0 + 2.0 * uvIn;
float len = length(p);
return uvIn + (p/len)*sin(len*12.0-time*4.0)*0.1 * rippleAmount;
}It's possible to offset the coordinate system of Ripple using the Position and Scale patch mod on the uv input port, which will cause the center of the ripple effect to move. But, since the output U/V includes that offset, every downstream patch will also move along with the ripple's center.
To fix: the output's offset should be reversed, comme ça:
vec2 rippleOut = undoPositionShift(ripple_main(applyPositionShift(uv));Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To do