Difference between revisions of "Warp Layer"

From Synfig Studio :: Documentation
Jump to: navigation, search
m (replace 'destiny' with 'destination')
m (edited for typos and some clarification)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
  
Warp layer is a simple but powerful distortion layer. In a few words it takes a rectangular portion of the resulting render of the layers that are behind it and maps the four corners of the rectangle to other four arbitrary points in the plane. It is a 2D -> 2D transformation.  
+
The warp layer is a simple but powerful distortion layer. In a few words it takes a rectangular portion of the resulting render of the layers that are behind it and maps the four corners of the rectangle to four arbitrary points in the plane. It is a 2D -> 2D transformation.  
  
 
== Warp Layer parameters ==
 
== Warp Layer parameters ==
  
Those are the parameters of the Warp Layer:
+
These are the parameters of the Warp Layer:
  
* Source TL (vertex): It is the Top Left corner of the source that is going to be mapped.  
+
* Source TL (vertex): The Top Left corner of the source that is going to be mapped.  
* Source BR (vertex): It is the Bottom Right corner of the source that is going to be mapped. With those two vertices is defined the Source rectangle.
+
* Source BR (vertex): The Bottom Right corner of the source that is going to be mapped. With those two vertices is defined the Source rectangle.
* Destination TL (vertex): It is the Top Left corner of the destination where the source is going to be mapped.
+
* Destination TL (vertex): The Top Left corner of the destination where the source is going to be mapped.
* Destination TR (vertex): It is the Top Right corner of the destination where the source is going to be mapped.
+
* Destination TR (vertex): The Top Right corner of the destination where the source is going to be mapped.
* Destination BL (vertex): It is the Bottom Left corner of the destination where the source is going to be mapped.
+
* Destination BL (vertex): The Bottom Left corner of the destination where the source is going to be mapped.
* Destination BR (vertex): It is the Bottom Right corner of the destination where the source is going to be mapped.
+
* Destination BR (vertex): The Bottom Right corner of the destination where the source is going to be mapped.
* Clip (boolean): When checked it only renders the destination pixels when they lie inside the destination quadrilateral.
+
* Clip (boolean): When checked it only maps the pixels which lie inside the Source rectangle.
*Horizon (Real): For infinite layers (gradients, chequerboard, etc.) it define where to stop rendering the points of the vanishing point. From 0.0 to 1.0 it renders all the points that are backwards on the perspective (in opossite direction to the vanishing point). From 1.0 to +infinite it renders the points that go in the same direction of the vanishing point. High value of Horizon makes synfig to spend a lot of time to render and the result is slightly visible better.  
+
* Horizon (Real): For infinite layers (gradients, chequerboard, etc.) it define where to stop rendering the points of the vanishing point. From 0.0 to 1.0 it renders all the points that are backwards on the perspective (in opossite direction to the vanishing point). From 1.0 to +infinite it renders the points that go in the same direction of the vanishing point. High values of Horizon make Synfig spend a lot of time rendering and the result is slightly visibly better.  
  
 
== Some Samples ==
 
== Some Samples ==
  
Here there are a sample images of the resulting of apply the warp layer over a chequerboard layer.  
+
Here are a few sample images of the result of applying the warp layer over a checkerboard layer.  
  
 
Before distortion:
 
Before distortion:
Line 24: Line 24:
 
[[Image:warp1.png]]
 
[[Image:warp1.png]]
  
The ducks of the warp layer:
+
The ducks of the warp layer.  The dotted lines represent the Source rectangle.  Notice how it corresponds to a 4 by 4 section of the checkerboard:
  
 
[[Image:warp2.png]]
 
[[Image:warp2.png]]
  
The resulting distortion (horizon = 15.0 and Clip = off):
+
The resulting distortion (horizon = 15.0 and Clip = off).  The destination rectangle can be seen to contain the same 4 by 4 section of the checkerboard that the source rectangle contains:
  
 
[[Image:warp3.png]]
 
[[Image:warp3.png]]
  
You can see that the rendered horizon is the resulting line of connect the two vanishing point of the perspective distortion. In this case there are two vanishing points given by the intersection of the lines that connects the following points:
+
You can see that the rendered horizon is the result of connecting the two vanishing points of the perspective distortion. In this case there are two vanishing points given by the intersection of the lines that connects the following points:
  
* Intersection of the line that passes by Destination TL point and Destination TR point with the line that passes by Destination BL point and Destination BR point. It gives vanishing point V1 (not shown in the diagram because it is outside the visible area).
+
* Intersection of the line that passes by Destination TL point and Destination TR point with the line that passes by Destination BL point and Destination BR point. It gives vanishing point V1 (not shown in the diagram because it is outside the visible area, far off to the left).
 
* Intersection of the line that passes by Destination TL point and Destination BL point with the line that passes by Destination TR point and Destination BR point. It gives vanishing point V2
 
* Intersection of the line that passes by Destination TL point and Destination BL point with the line that passes by Destination TR point and Destination BR point. It gives vanishing point V2
  
Line 43: Line 43:
 
[[Image:warp4.png]]
 
[[Image:warp4.png]]
  
 
+
To understand how the Horizon parameter works see this animated image. It moves the Horizon parameter from 0.0 to 30 in four seconds. Notice how far does it go from backwards to the bottom of the warp destination quadrilateral (''needs editing - I can't understand that'') and how it takes some time to approach the horizon.
To understand how the parameter Horizon works see this animated image. It moves the Horizon parameter from 0.0 to 30 in four seconds. Notice how far does it go from backwards to the bottom of the warp destination quadrilateral and how takes several time to reach the horizon.
+
  
 
[[Image:warpsample2.gif]]
 
[[Image:warpsample2.gif]]
Line 50: Line 49:
 
== The Clip parameter ==
 
== The Clip parameter ==
  
This image shows what you will get when check it on.  
+
This image shows what you will get when check it on.  Only the pixels from inside the Source rectangle are mapped.  In this case, the 4 by 4 section of the checkerboard.
  
 
[[Image:warp6.png]]
 
[[Image:warp6.png]]

Revision as of 09:50, 12 February 2008

Languages Language: 

English • русский


Introduction

The warp layer is a simple but powerful distortion layer. In a few words it takes a rectangular portion of the resulting render of the layers that are behind it and maps the four corners of the rectangle to four arbitrary points in the plane. It is a 2D -> 2D transformation.

Warp Layer parameters

These are the parameters of the Warp Layer:

  • Source TL (vertex): The Top Left corner of the source that is going to be mapped.
  • Source BR (vertex): The Bottom Right corner of the source that is going to be mapped. With those two vertices is defined the Source rectangle.
  • Destination TL (vertex): The Top Left corner of the destination where the source is going to be mapped.
  • Destination TR (vertex): The Top Right corner of the destination where the source is going to be mapped.
  • Destination BL (vertex): The Bottom Left corner of the destination where the source is going to be mapped.
  • Destination BR (vertex): The Bottom Right corner of the destination where the source is going to be mapped.
  • Clip (boolean): When checked it only maps the pixels which lie inside the Source rectangle.
  • Horizon (Real): For infinite layers (gradients, chequerboard, etc.) it define where to stop rendering the points of the vanishing point. From 0.0 to 1.0 it renders all the points that are backwards on the perspective (in opossite direction to the vanishing point). From 1.0 to +infinite it renders the points that go in the same direction of the vanishing point. High values of Horizon make Synfig spend a lot of time rendering and the result is slightly visibly better.

Some Samples

Here are a few sample images of the result of applying the warp layer over a checkerboard layer.

Before distortion:

Warp1.png

The ducks of the warp layer. The dotted lines represent the Source rectangle. Notice how it corresponds to a 4 by 4 section of the checkerboard:

File:Warp2.png

The resulting distortion (horizon = 15.0 and Clip = off). The destination rectangle can be seen to contain the same 4 by 4 section of the checkerboard that the source rectangle contains:

Warp3.png

You can see that the rendered horizon is the result of connecting the two vanishing points of the perspective distortion. In this case there are two vanishing points given by the intersection of the lines that connects the following points:

  • Intersection of the line that passes by Destination TL point and Destination TR point with the line that passes by Destination BL point and Destination BR point. It gives vanishing point V1 (not shown in the diagram because it is outside the visible area, far off to the left).
  • Intersection of the line that passes by Destination TL point and Destination BL point with the line that passes by Destination TR point and Destination BR point. It gives vanishing point V2

Connecting the Vanishing points V1 and V2 gives the horizon line.

See the diagram:

Warp4.png

To understand how the Horizon parameter works see this animated image. It moves the Horizon parameter from 0.0 to 30 in four seconds. Notice how far does it go from backwards to the bottom of the warp destination quadrilateral (needs editing - I can't understand that) and how it takes some time to approach the horizon.

Warpsample2.gif

The Clip parameter

This image shows what you will get when check it on. Only the pixels from inside the Source rectangle are mapped. In this case, the 4 by 4 section of the checkerboard.

Warp6.png


Languages Language: 

English • русский