Today we all met and sat down with the project. Today we continued to discussed how to make our project more like real water. One of the main weaknesses was that our model could only handle one epicenter at each time. Another was that we haven’t done anything concerning refraction and reflection on the water surface.
Epicenter class
To be able to handle and model more than one epicenter of the waves we need some way to represent and store the information for each epicenter. We decided to make a “class”/prototype for the epicenters. In these objects we store the information needed to model the waves from the epicenter, such as magnitude, decay, wavelength and start time.
List of all epicenters
With a decided way to represent and store the epicenter it is possible for us to place the objects in a list that we can go through when displaying the scene. However because of the fact that waves lose strength they will at some point have a magnitude of 0 and should be removed something we haven’t handled yet.
Improved Floating function
Last time we had a floating function that used the distances over/under the water surface to determine the velocities, “bounces”, on the water. This was refined by using the volume of the sphere that is under the surface of the water and then the lifting force is calculated. This is a more correct way of doing it. This approach is done with the sphere at the moment but could be implemented to other shapes if we decide to implement it later on.
Wave propagation
One thing that was a bit unrealistic in our scene before today was that when we started a new wave it immediately filled up the whole scene. With our new approach the wave starts from the epicenter and then propagate outwards.
Shader for the water surface
Today we continued to work on a shader for the water surface and we came to some result. The last couple of days we have investigated basically how we can use shaders in THREE.js and even if the one used today was one of their standard shaders we have come a long way of understanding how we can modify it for our project. We have understood that shaders itself could be a project of its own. Especially if you should account for all the characteristics of water: refraction, reflection, absorption reflectance, caustics and scattering.
First version of water surface shader.
At the moment our shader is not at all perfect however to get some reflection in the surface made a huge difference. However the surface looks like it is made of two segments something that looks really strange especially when the water is still. We might decide to make some small movements on the water even if no epicenter or movements are made.
Summary
- Epicenter class
- List of all epicenters
- Improved floating function
- Wave propagation
- Shader for the watersurface
Inga kommentarer:
Skicka en kommentar