Lecture 15

My thoughts

This is what I thought about after studying the chapter…

  1. the difference between point/line and polygonal models is significant
  2. how the graphics card connects to the cpu is significant
  3. trees are different because they aren't closed smooth volumes.
  4. It takes some effort, though it's not hard, to figure out whether or not to use points/lines or polygons.

Outline

This mostly an outline of Chapter 10 in Digital design of nature by Deussen and Lintermann.

Level-of-detail (LOD) methods reduce the level of detail in a model as the model recedes farther into the viewing distance. if a tree is point go be viewed at the size of 3x3 pixels, then it doesn't make much sense to ray trace out the entire tree to figure out 9 pixel colors.

Static: one model for each viewing distance and they are blended as the viewing distance changes.

Dynamic: the model itself changes as the viewing distance changes.

Of course, combinations are often used. Foreground: polygonal mesh (think detail), Midground: dynamic set of points or surfaces shrinks as object recedes. Background: maybe just a flat polygon aka a billboard.

Henceforth, the classification of LOD methods will be based on the underlying geometry. Trees are interesting because the geometry is either closed surfaces yet the foliage is many isolated shapes.

LOD for smooth surfaces

In a triangular mesh, remove an edge. Take the two adjacent vertices and move them to the middle of the removed edge.

For terrain application of this idea, see Lindstrom Real-time, continuous level of detail rendering of height fields. SIGGRAPH 96

Static LOD for trees

The main problem is getting the crown to look right.

Gardner [69] quadrics with transparency and color mapped. Efficient, often used in games, looks bad very close up.

Marshall [129] polygonal big stuff and tetrahedral small stuff. Still doesn't look good.

Max and Ohsaki [134] Multiple images, depth information, Novel views through reprojection. Handle occlusion Takes a lot of memory and backfilling is hard, so they take a hierarchical approach. Basically a study in putting together rotated and scaled copies of tree part photographs and putting them back together in tree shapes. Then replace things in the hierarchy with the photographs of those things as you get closer.

Neyret [147-149] volume textures applied to different geometry. Maybe brdf's too.

Shade et al. [195,196] used billboards at a distance, closer plants using re projection of photographs.

Dynamic point based methods

Points are a better modeling primitive for foliage than polygons because leafs seem like discrete points in space rather than collections of polygons (when viewed at a distance).

Need to minimize number of points (ie vertices) transferred to the gpu as the model recedes and the point cloud changes. using both lines and points minimizes this data transfer.

Weber and Penn [231] used lines and points for lod in their paper. Looks pretty good I think.

Shade et al. [195, 196] store occluded pixels during image production (ray tracing). Those images are then used to produce the final scene. During ray tracing, store not just color of first intersection, but color and depth of all intersections. reprojection is now easy because you just use the depth information to change the point of view. Looks good in the distance, not so much close up.

Dynamic Polygonal representations

Eventually, the point based methods need to switch back to polygons as the object gets closer to the view point.

Rossignac and Borrel [179] merge vertices within surfaces without worrying about connectivity. Looks good, except when the lighting changes?

"Drop and resize" A similar method approximates foliage with a small set of enlarged leaves. This leverages the fractal nature of tree.

If the viewing plane to the camera (focal point?) is 1 and the distance to a plant is $d$, then the projected surface size of a plant with surface $A$ is

(1)
\begin{align} A_i = \frac{1}{2}\frac{A}{d^2} \end{align}

multiply by 1/2 because only about 1/2 the leaves are visible, $1/d^2$ is the perspective change.

If you start off with $n$ leaves and want to display only $k$, then there should be a scaling factor to make the $k$ leaves bigger. That scaling is:

(2)
\begin{align} s(k) = w \sqrt{n/k} + (1-w) \mbox{ } w \in [0..1] \end{align}

where $w$ is a weighting factor. Medium scaling rate often best. No scaling is a thin foliage.

Deletion rate: defines how fast to thin leaves as the model recedes.

Min triangles: defines the min number of triangles to use in a tree as it recedes.

Leaves are deleted as a plane moves vert through the tree. Use the golden section to figure out where to delete leaves. That gives a nice spacing of deletion. Random would create clumps.

Move the horiz. plane through the tree vert. using a sine or square wave function. Sine function tends to remove more leaves from the center than at the edges of the crown. How?

Can be combined with billboards.

Point and line based rendering.

Deussen et al. [37] this is a point and line based method which exploits the gpu. Start with an ecosystem data file.

Add an LOD editor that approximates the geometry for fast rendering with points and lines.

When the triangle model for a leaf falls below the size of a single pixel, replace it with a point. Similarly for trunks, stems etc to be replaced with lines. Turns out that lines and points are more stable in animation anyway.

Nifty flow chart in figure 10.11 page 192

Processing the models

Div each plant into set of points and lines. User decides where to use each.

Set the vis important of each plant element. User does this too.

Sometimes use randomly placed points for the leaves (if there's lots of little ones) sometimes use poisson disk if there's big leaves.

Then, if three points are colinear, replace them with a line since rasterizing and drawing a line costs about the same as two points on the gpu. similarly, if four points are coplanar, replace them with a triangle.

figure 10.14 page 194 has a good example of using lines to render a scene with many plants.

clever method for replacing triangle model of a plant with the point/line model. Put the triangels in a display list (think opengl). Put them in random order. Since a triangle strip didn't work anyway, this is ok. Next, store the corresponding points and lines in the same random order. Store that in a display list as well. Suppose that both lists are n long. Then pick k between 1 and n. Switch from triangles to points and lines at index k in the display list. Not so much communication, easy to deal with importance,

but doubles data stored on the graphics card. So for large models, might have to do this on the fly.

Rendering

Now got the data in vertex lists on the graphics card. Need to display it.

first do culling of non visible plants.

next, figure out how much of the visible plants should be rendered (ie what's k going to be for each plant?) and how many points and lines are needed? Minimize errors and keep good appearance.

If p is greater than 3*triangles, just render out all the triangles.

complexity of redering grows in pixel size, not in object complexity. Good thing.

the scaling factor can be used to adjust rendering quality which can help frame rate during pans etc.

Hierarchical decomp. and optimzation.

A really big tree might need several lods even though it's a single object. So divide space and objects within space then adjust lod based on distance and not just by object.

On the other hand, if there's many plants per region of space, it's a pain to compute lod for each plant. they are all the same distance away, so compute lod for the region and apply it to each individual in that region.

Rendering

What to display and whether or not to display it as points/lines or triangles is all decided at run time.

assume that we have n triangles with area A.

approximate some of these triangles with lines L1 through Lnl.

approximate some of these triangles with points P1 through Pnp

Then TP is the triangles approximated by points and TL is the ones approximated by lines.

TL has area Al and TP has area Ap. so that Al+Ap = A.

User sets a sample distance parameter d'. Which is the average distance between point samples on the image plane. Large values of d' mean that samples in a "splat" for a plant are far apart so that the plant has fewer samples.

Let $A'sp = d'^2$. which is the area covered by a single point. So if d' is big, a single point covers alot of area. See figure 5 in the paper to understand what d' means.

Then we need the number of points required to model the plant. Call that p.

p depends on the surface area of the plant, Ap, the distance to the camera, r, so that the projected area of the plant is

(3)
\begin{align} Ap' = \frac{1}{2}\frac{Ap}{r^2} \end{align}

then the number of points required is

(4)
\begin{align} p = c_p \frac{Ap'}{Asp'}n_p \end{align}

So p is the number of points needed to cover an area of Ap' on the screen given that each point covers Asp' space and scaled by cp which is the size of each splat. Why multiply by the number of points, np?

If the number of points required, p, is greater than the number of points in the model, np, then the polygonal model is used. Otherwise, use p points.

Mike: the astute reader will note that p is greater than $n_p$ iff $c_p\frac{Ap'}{Asp'}$ is greater than 1. Hold that thought. In the discussion of lines later in section 5.2 of the paper, the authors will use that formulation of the decision without the $n_p$ term.

For lines, it's a little harder since two lines can be arranged to represent different things. So not only do we need to make sure we have enough lines to cover the area, we also need to make sure they are arranged properly.

First, we check the approximation error for the line projection. As before, r is the viewing distance and d' is sample distance parameter (they are using it like a pixel size). Suppose that the line set L1 through Lnl approximates TL with maximum distance (error?) $\vareps_l$

If

(5)
\begin{align} \vareps_l / r \geq d' \end{align}

then we have to use the triangles because the error is large enough that it's visible at resolution d'.

Otherwise, we have to compute the number of lines needed to cover the area of the plant described by lines and see if we have enough lines to cover that area (assuming that 1/2 the lines face the right way and that all the lines are the same length.

(6)
\begin{align} Asl' = l' d' = \frac{ld'}{2r}. \end{align}

Asl' is the projected area of the lines (note that we are projecting length not area so no need for r^2 in the denomenator). Figure out the ratio between the projected area of the lines and the projected area of the triangles in the plant…

(7)
\begin{align} ql = \frac{Al'}{Asl'} \end{align}

if ql < 1, draw ql nl of the lines else use the polygons.

Blending

Don't want to pop between points/lines and triangles. So do the blend more gradually.

For points, let $k$ equal number of triangles. if $p > 3k$ then use all triangles.

if $p < 2k$ then render the first $p$ points and the rest as triangles.

Results

70 million triangle model in 4 fps because they keep the sunflowers details.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License