<html>
<head>
<title>
Project 3 Help Session
</title>
</head>
<body>
<h1>
Project 3 Help Session
</h1>
CS 348B - Computer Graphics: Image Synthesis Techniques<br>
Spring Quarter, 1997<br>
Mark Levoy<br>

<h3> Outline </h3>

<ul>
<li> Assignment overview
<li> A real object
<li> Inventor - a primer
<li> The demo
<li> The competition
<li> TA's top ten tracing tips
<li> Questions
</ul>

<h3> Assignment overview -- Extending your ray tracer </h3>

<ul>
<li> Teams of N=1-3 people, N extensions
<li> Adaptive stochastic sampling
	<ul>
	<li> Strongly suggested (even partially, if not one of your 
		N extensions)
	<li> If one of your N:  Second image - Visualize rays per pixel
	<li> Bonus: can compensate for non-filtering of textures
	<li> Extra fun: microscopic view<br>
		<img src = "help3_supermicroviz.jpg">
	</ul>
<li> Distribution ray tracing
	<ul>
	<li> Multiple reflection rays
	</ul>
<li> Texture mapping
	<ul>
	<li> Strongly suggested 
	<li> Texture coordinates
	<li> Extra fun: mapping via 3D coordinates	
	<li> Spherical mapping
	<li> Modulate color, transparency, specularity, normal, or
		two different shading models (Cook '84, Perlin '85)
		<ul>
		<li> See James Davis's <a href="http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-94/"> credit card </a>
		</ul>
	<li> Environment mapping
	</ul>
<li> Shading language
	<ul>
	<li> Shade tree
	<li> Mix nodes according to textures
	<li> Extra fun: synthesis (reaction-diffusion, etc.)
	</ul>
<li> Light ray tracing
	<ul>
	<li> Bidirectional ray tracing (Heckbert, '90)
	<li> Hybrid ray tracing (Veach, '95)
	<li> See Len & Mavroidis's <a href="http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-94/"> swimming pool </a>
	</ul>
<li> Volume rendering
	<ul>
	<li> Atmospheric attenuation
	<li> Opacity/color variation over space
	<li> Extra fun: Hierarchical spatial subdivision
	<li> Extra fun: Turn on volume rendering only inside an object
		<ul>
		<li> E.g. <a href="http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-96/"> amethyst crystals </a>
		<li> Can define different functions inside different objects
		<li> With motion, can see it's 3D, not flat texture
		</ul>
	</ul>
<li> Fancy primitives
	<ul>
	<li> Bicubic patches
	<li> CSG models (see Robert Tobler's 
		<a href="http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-92/"> chess set</a>)
	<li> Fractals (see the texture-mapped <a href="http://www-graphics.stanford.edu/courses/cs348b-competition/cs348b-96/"> fractal dollar bill </a>)
	<li> Extra fun:  Fur as geometry (don't wait until the last day to render :-)
	</ul>

<li> Subsurface scattering
	<ul>
	<li> skin, plants, etc.
	<li> laser/light demo
	</ul>
</ul>

<h3> A real object </h3>
<ul>
<li> Must create it yourself
<li> i3dm, modeling demo  (the wine glass revisited)
<li> programs that generate Inventor (such as <a href="shell.c"> shell.c</a>)
</ul>

<h3> Inventor - a primer </h3>
<ul>
<li> Inventor: a hierarchical modeling language
<li> Look at the example .iv files
<li> Good reference: "The Inventor Mentor", if you want to know more
	<ul>
	<li> Available on some SGI's under insight.  Unfortunately, not on
		the Sweet Hall SGI's. :-(
	</ul>
<li> Example:  (/usr/class/cs348b/proj3/tetrahedron.iv)
<small>
<pre>

#Inventor V2.0 ascii

# Create a polyset of a tetrahedron, colored red, green, blue, white 
# on the corners.  It has per-vertex normals, per-vertex materials.
Separator {
  # The position of the 4 vertices
  Coordinate3 {
    point [ 
      	-1 -1 0,
      	 1 -1 0,
      	 0  1 0,
      	 0  0 2 
    ]
  }
  # The normals for each vertex
  NormalBinding {  value PER_VERTEX_INDEXED }
  Normal {
    vector [
	-1 -1 -1,
	 1 -1 -1,
	 0  1 -1,
         0  0  1
    ]
  }
  # Texture
  # Uncomment the "Texture2" line to make it texture-mapped.  Currently,
  # it ignores the texture coordinates, since no texture is specified.

  #   Texture2 { filename "/usr/demos/data/Inventor/defaultTexture.rgb" }
  TextureCoordinateBinding { value PER_VERTEX_INDEXED }
  TextureCoordinate2 {
    point [
	0 0,
	1 0,
	.5 1,
	.5 .5
    ]
  }

  # Per-vertex materials
  MaterialBinding { value PER_VERTEX_INDEXED }
  Material {
    diffuseColor [
	1 0 0,
	0 1 0,
	0 0 1,
	.8 .8 .8,
    ]
    specularColor [
	.3 .3 .3,
	.3 .3 .3,
	.3 .3 .3,
	0 0 0
    ]
  }
  # The indices of the polygons.  "-1" signifies the end of each polygon.
  IndexedFaceSet {
    coordIndex [
	0, 1, 2, -1,
        0, 1, 3, -1,
        1, 2, 3, -1,
	2, 0, 3, -1
    ]
  }
}

# Add a cube, as a base table for the tetrahedron
Separator {
  Transform {
	translation     0 0 -1
        rotation        0 0 1 .57
        scaleFactor     5 5 1
#        scaleOrientation        0 0 0 1
  }
  Material {
	ambientColor	0 0 0
	diffuseColor    0.2 .15 .1
        specularColor   0.3 0.3 0.3
        emissiveColor   0 0 0
        shininess       0.1
        transparency    0.0
  }
  Label {
    label   "Table bumpmap=woodbmp.ppm texmap=woodtex.ppm"
  }
  Cube {}
}

</pre>
</small>
</ul>

<h3> The demo </h3>
<ul>
<li> 15-minute, live demo
<li> Bring real-life object
<li> Show extensions of your raytracer
<li> Tell us all the cool stuff you thought up
<li> Writeup due the following Monday
</ul>

<h3> The competition </h3>
<ul>
<li> Can import existing models, textures, as background objects
	<ul>
	<li> Must identify any objects you didn't create
	<li> Self-made objects count a lot more
	</ul>
<li> Use fair tools (i3dm, Composer, Sweet Hall workstation tools)
<li> Use fair CPU (Roughly equal to a firebird)
	<ul>
	<li> Can only use multiprocessors if it doesn't interfere
	<li> If you want to do multiprocessor raytracing, start NOW!!!
	<li> Prizes: Siggraph trip, dinner at Il Fornaio, Siggraph videos
	</ul>
<li> Party afterwards (Yes, there will be food :-)
</ul>

<h3> TA's Top Ten Tracing Tips </h3>
<ul>
<li> 10. Have fun.
<li> 9. Go wild.  Be creative.
<li> 8. Spend time looking at things.  If friends/professors/advisors
	ask why you're staring off into space, tell them you're working
	on your raytracer project.  You are.
<li> 7. Don't leave the coding / modeling / raytracing to the end.
<li> 6. Do adaptive supersampling.  It looks pretty.
<li> 5. Form a group.  It lets you spend more time on the exotic, exciting 
	stuff.
<li> 4. Use images in your raytracing.  Color, bump maps, environment maps.
   	Images are easy to manipulate.  Use xpaint to draw them.  Use xv to
  	 change the color scaling, smooth them, crop them, etc.
<li> 3. Use images in your modeling.  Write programs that generate things
	like height-field meshes from an image.
<li> 2. Don't leave anything to the end.  Sleep is good.
<li> 1. Have fun.
</ul>


<h3> Questions </h3>


<p>
<hr>
<address>
lucasp@cs.stanford.edu
</address>
<b>Copyright &copy; 1997 Marc Levoy</b>
<br>
Last update: Friday, 23-May-97 
</body>
</html>
