Step 6: Implementing the iWave algorithm
Further researching the iWave algorithm has shown us that this seems like a realistic approach. Due to the provided code in the paper mentioned in the last post, we have been able to make large strides in implementing the algorithm. To make our project a bit different and not only try to implement the algorithm described in the paper, we also decided to go back to our original idea of having a tap pouring water and interacting with the mesh to create waves. For details about the algorithm we recommend you read the original paper by Tessendorf mentioned in the last blog post, however we will explain some nice-to-know parts of the algorithm that we deemed important.
The algorithm is primarily focused on being interactive (hence we chose to add the tap again) and fast. By combining functions that calculate the height of water surfaces calculating a waves motion and functions that conserve the water masses, it is possible to create realtively realistic looking waves/ripples in the water. The algorithm also uses explicit time stepping schemes, making it quite trivial to implement solutions while also maintaining a relativaly good speed. As we have already been down the road of advanced algorithms and implementations, we decided that this was worth a try as it seemed simpler compared to the previous algorithm and boy, were we right.
With multiple hours spent on re-reading Tessendorf's report and implementing the code, also taking inspiration from this blog that we found, we managed to get reasonable and quite satisfying results. What we have so far can be seen in the video below. The tap is unmovable in the game itself.
We decided to not implement a regular mesh as the paper, and the blog we found, did. Due to our previous tries with the Langarian method, we were quite familiar with rendering spheres in different patterns and we hence decided to do that in this case as well. In as we also use spheres as water particles to interact with the already existing water, we believe it was a fitting choice to omitt the mesh.
Our remaining plan is to polish the code as well as the visuals. We are planning on making more water like materials to use, making the tap moveable as well as maybe implementing foam when the water reaches certain heights as this usually happens for higher waves.
The algorithm is primarily focused on being interactive (hence we chose to add the tap again) and fast. By combining functions that calculate the height of water surfaces calculating a waves motion and functions that conserve the water masses, it is possible to create realtively realistic looking waves/ripples in the water. The algorithm also uses explicit time stepping schemes, making it quite trivial to implement solutions while also maintaining a relativaly good speed. As we have already been down the road of advanced algorithms and implementations, we decided that this was worth a try as it seemed simpler compared to the previous algorithm and boy, were we right.
With multiple hours spent on re-reading Tessendorf's report and implementing the code, also taking inspiration from this blog that we found, we managed to get reasonable and quite satisfying results. What we have so far can be seen in the video below. The tap is unmovable in the game itself.
We decided to not implement a regular mesh as the paper, and the blog we found, did. Due to our previous tries with the Langarian method, we were quite familiar with rendering spheres in different patterns and we hence decided to do that in this case as well. In as we also use spheres as water particles to interact with the already existing water, we believe it was a fitting choice to omitt the mesh.
Our remaining plan is to polish the code as well as the visuals. We are planning on making more water like materials to use, making the tap moveable as well as maybe implementing foam when the water reaches certain heights as this usually happens for higher waves.
Kommentarer
Skicka en kommentar