It’s only using multiple panners to simulate the waves which is easier than simpler.
However, I want to have the world displacement done to make it more realistic.
The current idea I have is to grab the normal vector and get the dot product with (0,0,1) to get higher value when the normal vector is closer to pointing straight up.
However, it only makes the entire surface vibrates randomly.
Am I having a wrong understanding about how the normal maps work?
There are some tutorial teaching me to use a texture map to get the right displacement map.
But since I’m using the normal map to simulate the water, I won’t be able to get the height map.
This is how my material looks right now.
there’s a node called something like heightmap from normal, it takes a texture object but you could probably open the function up and copy whatever it’s doing.
also worldposition has 3 components and uv’s expect 2 so you need a component mask, seems odd that it isn’t giving you an error. maybe the scale uv function has a mask in it?
So, first things first: I tried recreating your material, and did not have the entire surface move, only parts of the surface.
EDIT: Took another look at your material and noticed your scalar parameter (called 2) has a value of 0, This is causing your entire surface to move at once.
However, even with only parts of the surface moving, the displacement still looked nothing like water. Normal maps store the (fake) direction the surface points towards, relative to the actual direction of the surface. This means: there is no way to calculate a height map from a normal map, without running a function over every pixel of the picture.
The theory:
You would have to set one pixel as the relative zero height and then from there add and subtract the height gain for each pixel, calculated from the normal map. I have worked on a UE4 integrated function which does this, but normal maps are not mathematically accurate, so i stopped trying. You will need the height map or a morph texture if you want tessellation.
You could look at the permanently free pack “Water Materials” in the marketplace to look at other examples of water.
I thought there was both, but whatever. If you take the normal value and normalize it then take just the blue channel that’s you’re height map. May have to invert it or play with the contrast. Multiply that by the vertex normal and put it the displacement. Multiply the heightmap by a constant 1(not3) to adjust displacement amount.
Well, normal maps are already normalised. The information stored inside it is merely the change in direction relative to the actual surface of the map. Using only the blue channel does not give you the actual height map, it gives you higher values for the flat parts of the surface.
Just in case you phrased this wrong and were talking about the cross product (which is not a simple multiplication) I made this example:
Here you can see that creating a heightmap from the normal map using the cross product and then using this heightmap to create the normal map does not result in the same normal map. Feel free to try this yourself, or point out mistakes I made, if you wish.
Usually height maps are not provided in asset packs, sadly. The way I see it: If someone creates textures/assets for you, always ask for both, height and normal maps.