|
We will begin our project by researching the mathematical behavior of water. After developing a simple animation (i.e. wireframe) of the effect of an impulse on water, we will then study its effects on caustics. Because caustics require so much calculation, we will research different methods of modeling caustics efficiently in an interactive environment. |
|
Our first attempts at creating a wave...
|
|
And a ripple...
|
|
First Deliverable Executable - The camera controls are similar to as2. - 'v' simulates hard rain - 'b' simulates light rain - '5' creates one ripple in the middle of tthe water - middle mouse click creates a ripple wheree you click - not very accurate at the moment - 'w' creates a wave, but not implemented vvery well, so have to wait for the wave to die down to be able to do any other controls |
|
Research on Caustics Caustics are a typical indirect lighting effect due to light refracted through water. In the "Deep Water Animation and Rendering" paper, Lasse Jensen computes only the first order rays (the ones directly refracted from the surface of the water) and assumes the floor of the pool is at a constant depth, which allows caustics to be rendered in realtime. Since we use a triangle mesh to represent the surface of our water, it is a simple matter to implement Watt&Watt's light beam-tracing scheme. For each vertex on each triangle, we calculate refracted rays using Snells Law : ![]() and the equation for a refracted ray : ![]() on the vertex's normal and incident light vector. For this calculation, we also made the assumption that the light source was distant enough to be constant over our surface. Using similar triangles, we were able to calculate the intersection of these rays with the floor of the pool, giving us the coordinates for the caustics's triangle. From here, the intensity of each caustic triangle is dependent on the ratio of its area and the area of the original triangle. So intensity is calculated with : ![]() |
|
User Interface To implement ripples, we used the algorithm from this website . There are some problems though, because the ripple is very jagged, so we are working on trying to smooth the edges of the ripples, which should also improve the look of the caustics. We had to implement this method of rippling, rather than using a sinusoid function and time, because we wanted to be able to have multiple ripples at a time, and we wanted the user to be able to move the camera around, and interact with the environment as the ripples occurred. Therefore we used the glutIdleFunction() method, so that the ripples would run in the background, and taper off while allowing the user to do other things. The rain was implemented by breaking up the "water grid" into 16 components, and it randomly chooses some number of those components to create a ripple. We also randomly alter the position of the ripples, and alter the strength and duration slightly. The wave, on the other hand, is implemented with a sinusoid function and time, so the user cannot do anything while the wave is going. We are trying to figure out another way to implement waves, but we think the rippling creates better caustics effects anyways. |
|
|
| Back to Index | To Second Deliverable | To Final Deliverable |