Reflections and Refractions | Babylon.js Documentation ().Happy Holidays Node Material Displacement Demo - YouTube.Interactive Hex Tiles: Part 4 - Node Material Noise - YouTube.There are some examples of the different ways you can approach it in our examples and YouTube content. Unless you really need to show what is beneath the water, I would suggest going with a direction more like what the last video you shared shows in just using a plane with no animated vertices and just mapping a mirror texture with some animations in the uvs. The original concept you shader was very stylized, but adding reflections takes the stylization more toward realism. So heavier mesh, calculations per vertex for position, and then mirror texture pumped into the shader. However, you will need a very dense mesh or your waves will not be smooth. If we need to show the change from the side of the water as well, you need vertex displacement in the shader. The surface can be a simple plane with an animated normal texture that is bending the surface normals for the mirror texture to distort. This is because it’s far more expensive to show the side as well. Notice in your example above, the water you see is only the surface and not the side. This is because if you want a mirror reflection, you will want distortions in the refection due to the waves, but you will also need to match those distortions with the waves that are rendered in the intersection between the top and side. Now you need to make your water a cube so that you have a normal facing up for reflection and a normal facing toward the camera. The reason for this is that you want the water surface normal to point toward what it will reflect and in my example the surface normal of the water could point at the camera since the camera perspective would make it look right. In this case, adding reflections to the water requires a completely different approach because we need to account for a mirror texture like in the example you linked. #SPRITE SHEET WATER SPLASH PNG FREE#Hope this helps get you going in a direction, but please feel free to ping me if you have more this is why it is good to clearly define the concept you are going for before you start rolling with your art assets because adding something in later may completely change the approach. Then scale the wave up and down again vertically, maybe ramping opacity as well and you should get the sense of these wave peaks rolling on the water. The particle texture should be just the small caret shape, though you could make a simple sprite sheet of several if you want some variation. Babylon uses DirectX format for UV space by default so if you create your planes with Babylon.js primitives, you will want to remove the OneMinusBlock here.įor the little crests of the waves on top, I would use a particle system with an emitter the size of your water that emits particles parallel with the emitter surface in one direction. This is because the preview models in NME are glTF models which use an OpenGL format for UV space. I have a OneMinusBlock right after splitting the mesh.uv on the Y component. You can control wave speed, wave frequency, wave amplitude, water height, edge thickness, and edge transition (the anti-alias on the edge stroke) to dial it all in to look right in your scene.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |