![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Final Deliverable: | ||||||||||||||
A lot has changed since our last deliverable. We have implemented several different mathematical models to implement reflection and refraction. To do this, we used Snell's Law of Refraction and the Fresnel term for blending reflective and refractive terms. We used the following equations that we found from GamaSutra. | ||||||||||||||
![]() |
||||||||||||||
This term calculates the refraction vector that is created by a given eye and a norm. For reflection, we used the equation: R = 2 (E dot N) N - E Similarly, this equation gives us the vector of reflection given an eye and a norm. |
||||||||||||||
We created our water texture by blending a scene of the ground and a scene of a light blue sky with clouds, and combined them using the above terms. We are able to alter the level of with which these terms blend (simulating different angles of view), giving the water the appeareance closer to that of the ground or closer to that of the sky. Our splashes are done in yellow because when they were done in blue, they were hard to notice within the scene. Because of system inconsistencies, the realistic speed of the objects' descents is no longer apparent, though we can show this in earlier parts of our project. Due to this factor, our ripples look a lot better in the mesh by itself than when we do the complete texture map for the water. Trying to optimize for speed, we were forced to make our mesh small, which can be seen in the triangular discontinuities at the edges of the water. We calculated planar normals for each triangle in our mesh, using , although doing some sort of Goraud or Phong interpolation would have made our water much better looking. We were able to create some elementary .rib files that we were planning on using in Renderman, but we had trouble interfacing them with BMRT because the metaball functions we were planning to use were not available to us. |
||||||||||||||
We started out with a sinusoidal ripple in the first deliverable, but we had trouble figuring out how to change the values of the ripple on the fly. We searched on the web for some ripple algorithms, and we found the area sampling algorithm to be very common. The way this algorithm works is that for each vertex, the algorithm adds up the z-values of the top, bottom, left, and right nearby vertices. It divides by two, which results in a values that's roughly twice the size of what the actual value should be. Next, it subtracts the value of the vertex in question from two frames ago, which is effectively the velocity from the second previous frame to the previous frame. Then the value is multiplied by a dampening factor, which is used to level out waves. We chose to go one step further with the algorithm and check all nearby vertices (including the diagonals). This didn't give much of a performance slowdown and the results were rather nice. | ||||||||||||||
Files: waterfinal.zip Previous version (without texture mapping) |