gzz-commits
[Top][All Lists]
Advanced

[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: Sun, 17 Nov 2002 10:21:04 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/11/17 10:21:04

Modified files:
        Documentation/Manuscripts/Irregu: irregu.tex 

Log message:
        more

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/Manuscripts/Irregu/irregu.tex.diff?tr1=1.49&tr2=1.50&r1=text&r2=text

Patches:
Index: gzz/Documentation/Manuscripts/Irregu/irregu.tex
diff -u gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.49 
gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.50
--- gzz/Documentation/Manuscripts/Irregu/irregu.tex:1.49        Sun Nov 17 
07:15:45 2002
+++ gzz/Documentation/Manuscripts/Irregu/irregu.tex     Sun Nov 17 10:21:04 2002
@@ -317,10 +317,16 @@
 
 Although these algorithms seem different and produce different results, there 
is 
 actually a reasonable generalization which yields to a visual explanation.
-Both algorithms can be seen as computing the intersection of (the volume
-below) the surface $(p, f(p))$ and a \emph{cutting surface} $(E(s,g(t)), t)$, 
+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 parametrization of the cutting surface.
+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. 
@@ -332,9 +338,11 @@
 \section{Hardware-accelerated implementation}
 
 In the following, we shall concentrate on drawing one section
-of the envelope, in the unit square: $0\le s\le1$, $0\le t\le1$.
-It assumed that the position $E(s,t)$ inside the section of the envelope 
-and the function $g(t)$ depend linearly on the parameters $s$ and $t$.
+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 
+envelope depends linearly on the parameters $s$ and $t$.
+[XXX: should we assume that $E(s,t)$ is identity].
 
 We shall concentrate on OpenGL and NVIDIA extensions (due
 to their availability in the Linux environment), but 
@@ -354,21 +362,21 @@
 
 \subsection{Drawing the shape}
 
-Recall that the torn shape can be defined as the intersection
-of a surface $(p,f(p))$ and a cutting plane $(E(s,g(t)),t)$.
-Using the same parametrization for both surfaces, a point $E(s,t)$
-is inside the tear-out, iff
-\begin{equation}
-    f(E(s,g(t))) \ge t.
-\end{equation}
-
-Because $E(s,t)$ and $E(s,g(t))$ are both affine functions,
-we can draw the section as a single QUAD with object position 
-interpolated as $E(s,t)$, texture coordinates as $E(s,g(t))$,
+Recall that the torn shape is defined as the intersection
+of the volume below $(p,f(p))$ and a cutting surface $(E(s,g(t)),t)$.
+Because $E$ and $g$ are assumed to be affine, the cutting
+surface is actually a plane.
+The intersection is given by Eq.~\ref{eq:inside}, which can be written as 
+point $E(s,t)$ being inside the tearout, iff
+\[
+    f(E(s,g(t))) + (1-t) \ge 1.
+\]
+Because $E$ and $g$ are affine,
+we can draw the section of the envelope as a single QUAD 
+with texture coordinates interpolated as $E(s,g(t))$
 and the alpha component of the primary color as $(1-t)$.
-The above inequality can be written as $f(E(s,g(t))) + (1-t) \ge 1$.
-The left side can be computed using texture environment mode ADD
-and an INTENSITY texture storing $f(p)$.
+The left side of the above inequality can be computed using 
+texture environment mode ADD and an INTENSITY texture storing $f(p)$.
 The alpha output of the texture environment can then be tested
 against $1$ using ALPHA\_TEST to discard fragments outside
 the tear-out.
@@ -376,6 +384,16 @@
 
 [GL\_EXT\_texture\_env\_add or OpenGL 1.3 required]
 
+
+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 algortihms.
+
+
 \if0
 \subsection{A shape with the correct type of motion}
 
@@ -446,19 +464,16 @@
 any of the adjacent inner edge points is less than the line width.
 This computation can be carried out using GL\_NV\_register\_combiners.
 
-With NV30, a single texture unit can be accessed multiple
-times with displaced texture coordinates computed in a fragment program.
-
-\subsubsection{Optimizations}
-
-Pre-computed edge width: interpolated between
-3 or 4 stored angles.
+\subsubsection{Pre-computed borders}
 
-A circle (or ellipse, depending on how much the cutting plane is 
-stretched on screen) is moved inside the cutting plane so that
-it always touches the surface, but never crosses it. 
-The center of the circle draws the outer edge of the border.
-The radius of the circle determines the line width.
+It is possible to draw the border by simulating the procedure of 
+drawing a thick line:
+A circle on screen with radius corresponding to the desired line
+width is projected back to the cutting plane and then
+moved inside the cutting plane so that
+it always touches the ripple volume, but never crosses it. 
+The center of the projected circle (ellipse) draws the 
+back-projected outer edge of the border.
 
 If the cutting plane is then moved (without rotating it) 
 around the surface, the outer edges corresponding to each
@@ -473,8 +488,8 @@
 slopes of the cutting plane so there is no problem in storing
 these discrete choices in different textures.
 However, the tearout shape can rotate, requiring surfaces
-for all tearing directions in the paper. 
-We compute the outer surfaces for a small number of different 
+for all tearing directions in the canvas. 
+We compute the \emph{outer surfaces} for a small number of different 
 tearing directions and store them
 in the components of a texture. 
 The surface corresponding to a a tearing direction between 
@@ -494,29 +509,42 @@
 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 through mip-mapping.
-%Pyramidal parametrics, Lance Williams (mipmap) ref.
+Non-photorealistic line width scaling can be obtained by computing
+each mip-map level of the outer surface textures separately 
+%cite Pyramidal parametrics, Lance Williams (mipmap) ref.
+with the desired line width for that scale.
+Because the textures store displacement values, 
+the mip-map levels interpolate seamlessly.
+However, zooming above the highest level of detail in the mip-map
+will fall back to the linear scaling.
+%XXX: could interpolate towards inner edge with DP4 and texture w/ 3 angles
+This method of computing mip-maps is similar to the art maps used in 
+\cite{klein00nonphotorealistic}.
 cite rip-maps
 
-
-
-Magnification
-
-
-
-profiles
-
-
 Issues: \\
-- line width scaling \\
 - projective mapping \\
-- complexity of vertex computations \\
-- repeated vertices (non-continuos per-vertex data) \\
 - antialias \\
 
 \subsubsection{Offset texture}
 
-For attached edges
+For connected edges: 1D texture representing the border is
+offset with the ripple texture value.
+Mip-maps can be computed with constant line width.
+Because mip-map $\lambda$ values are computed for each pixel,
+the resulting border width is correct for the local slope
+of the displacement. 
+However, derivative discontinuities are sometimes visible
+as spikes in the border. 
+Also, increasing the scaling exponent from 0 makes the
+border width not scale correctly with the edge slope.
+
+\subsection{Future work: NV30}
+
+With NV30, more accuracy with floating point textures.
+More procedural textures with fragment programs.
+A single texture unit can be accessed multiple
+times with displaced texture coordinates computed in a fragment program.
 
 \subsection{Tearout shapes}
 
@@ -524,22 +552,23 @@
 Inside only needs to be drawn twice. ???
 Can create ``outside'' stencil and draw inside only once.
 
+Curved lines: \\
+- dicing \\
+- non-rectangular segments need projective texture mapping for
+  the connected case: rectangular sections are stretched together
+
 Corners: \\
-- motion problem with non-rectangular segments on a straight line
+- motion problem with connected edge on non-rectangular segments 
+  on a straight line
   (the ripples ``rotate'' when the tearout shape moves)  \\
 - rounded corners to make segments more rectangular \\
 - creating corners by intersecting too straight lines with stencil \\
 \\
-Curved lines: \\
-- dicing \\
-- projective texture mapping (may need to increase dicing to
-  prevent discontinuities between segments).
-  XXX: if curvature is not continuous (e.g., a quarter circle corner
-  on straight edges) dicing the tearing line does not prevent discontinuities:
-  straight lines have no perspective, but all circle sections have 
-  perspective distortion relative to the ratio of outer and inner radii.
 
-Jigsaw puzzle problems.  
+Jigsaw puzzle problems: \\
+- tear-out pieces do not fit together \\
+- partially solved using inverted version of the texture \\
+- better solution by using a two-component texture
 
 \section{Example applications}
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]