= Final Project = == Group Members == Christina Chan [[BR]] Crystal Fong == Project Proposal == Our final project proposal can be found at CrystalFong/FinalProjectProposal == Overview == The goal of our project is to render an underwater scene of clownfish and sea anemone. To achieve this, we implemented two different subsurface scattering techniques to simulate the glowing and lighting of an underwater image. == Reference image == ||attachment:iphone.png|| == Approach == === Fish (Christina) === ==== Model ==== ==== Techniques ==== ==== Technical Challenges ==== === Anemone (Crystal) === ==== Model ==== The anemone model was procedurally generated using a python script to create a scene file. Each anemone stalk has a Catmull-Rom spline as a backbone, and is modeled using generalized cylinders (seethe Resources section for a link to a tutorial). The script takes a control point list as input to set the initial spline curvature. To interpolate one point, it is necessary to have 4 control points (2 on each side of the desired point.) Intermediate points are generated using the following equation where p_i is a control point and t is a value between 0 and 1 that represents the distance of the desired point from the second (P1) point (where t=0 is at P1 and t=1 is at P2). [[BR]] q(t) = 0.5 * ((2 * P1) + (-P0 + P2) * t +(2*P0 - 5*P1 + 4*P2 - P3) * t2 + (-P0 + 3*P1- 3*P2 + P3) * t3) [[BR]] At each point(q), we calculate and store the normal(N), tangent(T) and binormal(B). This is accomplished by the following steps. * For the very first point, select T, N, and B. * For each point Q1: [[BR]] T1 = unit(Q1 - Q0)[[BR]] N1 = unit(B0xT1) where x is the cross product[[BR]] B1 = unit(T1xN1) [[BR]] * store T,N, and B with each point After the spline is fully specified, each vertex(q) along the spline becomes the center point of a ring of vertices that will define the cross-section of the stalk at that point. The stalk starts out with a maximum radius of .5 and tapers as it grows upwards. At 5/8 * height of stalk, a bulb shape is formed by using a sin function to control the radius of the stalk. Each point(c) on the ring of vertices are calculated by c = radius * (cos(theta),sin(theta),0) where theta is an angle between 0 and 2pi. The point is then translated based on the normal (N) and binormal(B) of current the spline vertex. This is to avoid twisting of the generalized cylinder. We used the following equation to calculat the translated point: [[BR]] translated point = c.x * N + c.y*B + q [[BR]] When all of the points have been generated, a triangle mesh is created and saved in the format of a pbrt scene file. Each anemone is a variation of the input control vertices, but each are translated to a different position, and the spline is modified somewhat to make each stalk unique. To ensure that the stalks do not intersect, each stalk attempts to place itself in such a position that there is not another stalk within a defined radius of each of its spline points. [[BR]] Here is a preliminary image of the anemone stalks after generation. attachment:splines.png ==== Techniques ==== ==== Technical Challenges ==== == Final Image == attachment:fish_3.png == Resources == Pat Hanrahan and Wolfgang Kreuger: [http://graphics.stanford.edu/papers/subsurface/ "Reflection from Layered Surfaces due to Subsurface Scattering"] Computer Graphics (Proc. SIGGRAPH 1993), July 1993 [[BR]] Henrik Wann Jensen, Stephen R. Marschner, Marc Levoy and Pat Hanrahan: [http://graphics.stanford.edu/papers/bssrdf/ "A Practical Model for Subsurface Light Transport"]. Proceedings of SIGGRAPH'2001. Henrik Wann Jensen and Juan Buhler: [http://graphics.ucsd.edu/~henrik/papers/fast_bssrdf/ "A Rapid Hierarchical Rendering Technique for Translucent Materials"] Proceedings of SIGGRAPH'2002 [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15462/web.01s/assts/asst2_notes/primer.html Tutorial on generalized cylinders ] [http://www.mvps.org/directx/articles/catmull/ Tutorial on Catmull-Rom Splines]