[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex |
Date: |
Tue, 19 Nov 2002 06:49:07 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/11/19 06:49:06
Modified files:
Documentation/Manuscripts/Irregu: irregu.tex
Log message:
small changes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/Manuscripts/Irregu/irregu.tex.diff?tr1=1.53&tr2=1.54&r1=text&r2=text
Patches:
Index: gzz/Documentation/Manuscripts/Irregu/irregu.tex
diff -u gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.53
gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.54
--- gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.53 Mon Nov 18
12:05:36 2002
+++ gzz/Documentation/Manuscripts/Irregu/irregu.tex Tue Nov 19 06:49:05 2002
@@ -165,7 +165,7 @@
Buchanan, Sousa: The edge buffer NPAR 2000
Northrup, Markosian: Artistic silhouettes NPAR 2000
-Saito, Takahashi -- *the* reference (Image-space algorithm) - Computer
Graphics Vol24 no4
+Saito, Takahashi -- *the* reference (Image-space algorithm) - Computer
Graphics Vol24 no4 %\cite{saito90comprehensible}
CARTOONS, SPEECH BUBBLES and FRAMES!!
NEWSPAPERS, TORN ARTICLES
@@ -184,7 +184,9 @@
``torn edge'' = ?,
``thickness of roughness'' = ?,
``border'' = ?,
-``section/segment of envelope'' = ?.
+``section/segment of envelope'' = ?,
+``inner edge (of the border)'' = ?,
+``outer edge (of the border)'' = ?.
In this section, we introduce the use of non-photorealistic rough, torn shapes
instead
of the usual rectangular, clipped and framed viewports.
@@ -307,7 +309,7 @@
For the connected edge, we can obtain the final edge curve $C(s)$ by
simply shifting
the spine of the envelope along its normal direction by a function
-$0\le f(p)\le 1$ which only depends on the location of the spine:
+$0\le f(p)\le 1$ which only depends on the location $p$ of the spine:
$C(s) = E(s, f(E(s,1/2)))$.
The scattered case, on the other hand, can be obtained through a decision
process:
@@ -315,32 +317,41 @@
a given point $E(s,t)$ is {\em inside} the tear-out,
iff $f(E(s,t)) > t$.
-% XXX: the irregu_gears.jpeg issue should be addressed here, i.e., the shape
-% of the torn edge should ideally not depend on normal in/out direction.
+A suitable choice for $f$ would be
+a function with noise at different frequencies, but with lower frequencies
+emphasized more, such as turbulence\cite{perlin-noise-intro}.
+
Although these algorithms seem different and produce different results, there
is
-actually a reasonable generalization which yields to a visual explanation.
+actually a general formulation which yields to a visual explanation.
Both algorithms can be seen as computing the intersection of
\emph{ripple volume}, the volume below the surface $(p, f(p))$,
and a \emph{cutting surface} $(E(s,g(t)), t)$,
and then mapping the intersection on the envelope $E(s,t)$
using the parameters of the cutting surface.
-Using this parametrization for both surfaces, a point $E(s,t)$
-is inside the tear-out, iff
-\begin{equation} \label{eq:inside}
- f(E(s,g(t))) \ge t.
-\end{equation}
+
The function $g$ (actually its inverse) defines the profile of the
cutting surface, with $g(t) = t$ for the scattered case and $g(t) = 1/2$,
i.e., a vertical surface, for the connected case.
+Other choices for $g$ are possible, but not very useful, because they
+correspond to just different distortions of the same basic shape.
-A suitable choice for $f$ would be
-a function with noise at different frequencies, but with lower frequencies
-emphasized more, such as turbulence\cite{perlin-noise-intro}.
+Using the same parametrization for both surfaces, a point $E(s,t)$
+is inside the tear-out, iff
+\begin{equation} \label{eq:inside}
+ f(E(s,g(t))) \ge t.
+\end{equation}
+For more variation on the edge shapes, the inequality can be
+generalized to
+\begin{equation} \label{eq:inside2}
+ (1-\alpha(t)) f_1(E(s,g_1(t))) + \alpha(t) f_2(E(s,g_2(t)) \ge t,
+\end{equation}
+where the $\alpha(t)$ parameter specifies interpolation between
+two different shapes.
\section{Hardware-accelerated implementation}
-In the following, we shall concentrate on drawing one section
+In the following, we shall concentrate on drawing one rectangular section
of the envelope, in the unit square, with $t=0$ inside the tear-out,
$t=1$ outside the tear-out, and $s$ along the length of the envelope.
It assumed that the canvas position $E(s,t)$ inside the section of the
@@ -387,14 +398,17 @@
[GL\_EXT\_texture\_env\_add or OpenGL 1.3 required]
+Using two texture accesses, it is also possible to compute
+the generalized case given in Eq.~\ref{eq:inside2} using
+GL\_NV\_register\_combiners and interpolation parameter of the
+form $\alpha(t) = a t + b$.
+Even if using just $g_1 = g_2$ and $\alpha(t) = 1/2$, this formulation
+allows an infinite non-repeating area of different shapes by making
+the ripple functions $f_1$ and $f_2$ repeat at non-rationally
+related periods.
-XXX: two texture accesses could be used to compute
-\[
- (1-\alpha(t)) f_1(E(s,g_1(t))) + \alpha(t) f_2(E(s,g_2(t)) \ge t
-\]
-for intermediate shapes and larger repeating unit in
-the canvas (if the mapped sizes of two textures are not rationally related).
-However, it brakes most of the border drawing algorithms discussed below.
+On the other hand, this formulation brakes most of the border
+drawing algorithms discussed below.
\if0
@@ -437,7 +451,7 @@
Mathematically, the border of an irregular tear-out is defined as
the set of points whose distance from the tear-out is less than
or equal to the desired line width.
-In the following, we consider different ways approximating
+In the following, we consider different ways for approximating
the border.
\subsubsection{The oldest trick}
@@ -534,7 +548,7 @@
A four-component texture can store angles 45 degress apart for a vertical
cutting plane and 90 degrees apart for a non-vertical plane.
-Non-photorealistic line width scaling can be obtained by computing
+Non-photorealistic line width scaling is obtained by computing
each mip-map\cite{williams83pyramidal}
level of the outer surface textures separately
with the desired line width for that scale.
@@ -590,7 +604,7 @@
Curved envelopes can be approximated by dicing to linear pieces.
In the connected case, the sections are drawn as if they were
rectangles of such lengths that the spines of the adjacent sections meet.
-Projective texture mapping is used to stretch together the sides of the
+Projective texture mapping is used to shear together the sides of the
adjacent rectangles.
In the scattered case, the sections are drawn simply
as overlapping rectangles,
@@ -618,7 +632,7 @@
the outer edges of the borders.
The intersection can be implemented by drawing the outside
-of the tear-out to the stencil buffer for each side of the shape.
+to the stencil buffer for each side of the shape.
The inside is then drawn with a polygon
surrounding the inside and the envelopes of all sides
with stencil test set to discard those fragments that were
@@ -628,22 +642,20 @@
(the stencil can be cleared as the contents are drawn).
If a canvas is torn into multiple pieces, the above methods
-produce edges that do not fit together: the ripple volume
-cutting surfaces are always directed with upward slopes
-towards the normals of the envelopes, creating opposing
-ripples for adjacent tear-out pieces.
+produce edges that do not fit together: the edges of adjacent
+pieces have opposing ripples.
The problem is partly solved by inverting ($1-f(p)$)
the ripple function for either one of each pair of facing sides.
But then a 180 degree rotation of a pair of fitting pieces
-inverts the torn line between them, breaking the principle of
+inverts the torn shape between them, breaking the principle of
tying ripple shape to canvas positions.
-The problem can be solved with a vector valued ripple function $F(p)$:
+The problem can be fully solved with a vector valued ripple function $F(p)$,
using $f(p) = (1 + d\cdot F(p))/2$, where $d$ is the unit normal
-of the envelope, automatically inverts the function for 180 degree
-rotation.
-The vector valued function can be directly used with the
-pre-computed borders method, by pre-computing the dot product
+of the envelope. The dot product automatically inverts the
+function for a 180 degree rotation.
+This function can be directly used with the
+pre-computed borders method by pre-computing the dot product
when computing the outer surfaces. As a bonus, the scattered
case, too, then needs to store only a span of 180 degrees.
The texture shader version can also use vector valued ripple function
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, (continued)
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/13
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/13
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/13
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/14
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/15
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/17
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/17
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/17
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/18
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/18
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex,
Janne V. Kujala <=
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/19
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/19
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/19
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Janne V. Kujala, 2002/11/19
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/20
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/20
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/20
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/20
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Tuomas J. Lukka, 2002/11/20
- [Gzz-commits] gzz/Documentation/Manuscripts/Irregu irregu.tex, Benja Fallenstein, 2002/11/22