Difference between revisions of "Warp Layer"

From Synfig Studio :: Documentation
Jump to: navigation, search
(First release of warp layer page)
m (replace 'destiny' with 'destination')
Line 9: Line 9:
 
* Source TL (vertex): It is the Top Left corner of the source that is going to be mapped.  
 
* Source TL (vertex): It is 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): It is the Bottom Right corner of the source that is going to be mapped. With those two vertices is defined the Source rectangle.
* Destiny TL (vertex): It is the Top Left corner of the destiny where the source is going to be mapped.
+
* Destination TL (vertex): It is the Top Left corner of the destination where the source is going to be mapped.
* Destiny TR (vertex): It is the Top Right corner of the destiny 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.
* Destiny BL (vertex): It is the Bottom Left corner of the destiny 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.
* Destiny BR (vertex): It is the Bottom Right corner of the destiny 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.
* Clip (boolean): When checked it only renders the destination pixels when they lie inside the destiny quadrilateral.
+
* Clip (boolean): When checked it only renders the destination pixels when they lie inside the destination quadrilateral.
 
*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 value of Horizon makes synfig to spend a lot of time to render and the result is slightly visible better.  
  
Line 34: Line 34:
 
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 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:
  
* Intersection of the line that passes by Destiny TL point and Destiny TR point with the line that passes by Destiny BL point and Destiny 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).
* Intersection of the line that passes by Destiny TL point and Destiny BL point with the line that passes by Destiny TR point and Destiny 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
  
 
Connecting the Vanishing points V1 and V2 gives the horizon line.
 
Connecting the Vanishing points V1 and V2 gives the horizon line.
Line 44: Line 44:
  
  
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 destiny quadrilateral and how takes several time to reach 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]]

Revision as of 03:39, 12 February 2008

Languages Language: 

English • русский


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.

Warp Layer parameters

Those 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 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.
  • Destination TL (vertex): It is 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 BL (vertex): It is 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.
  • Clip (boolean): When checked it only renders the destination pixels when they lie inside the destination quadrilateral.
  • 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.

Some Samples

Here there are a sample images of the resulting of apply the warp layer over a chequerboard layer.

Before distortion:

Warp1.png

The ducks of the warp layer:

File:Warp2.png

The resulting distortion (horizon = 15.0 and Clip = off):

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:

  • 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 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 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.

Warpsample2.gif

The Clip parameter

This image shows what you will get when check it on.

Warp6.png


Languages Language: 

English • русский