Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to find the actual height of terrain water waves at a position?

Asked by
CodeNil 30
8 years ago

I cant figure out how to get the equation used for waves. https://twitter.com/fluffmiceter/status/762319715394019329 That code almost works but its not right, ive tried the shift stated there too.

Ive also looked through the shader code but that doesnt help much either as there are many unknown variables

  result_7.y = (tmpvar_3.y + ((
    (sin(((
      (tmpvar_3.z - tmpvar_3.x)
     * CB3[0].x) - CB3[0].y)) + sin(((
      (tmpvar_3.z + tmpvar_3.x)
     * CB3[0].x) + CB3[0].y)))
   * CB3[0].z) * (tmpvar_6 * 
    clamp ((1.0 - (dot (
      (tmpvar_3 - CB0[7].xyz)
    , 
      -(CB0[6].xyz)
    ) * CB0[19].y)), 0.0, 1.0)
  )));

Thats the shader code for wave height. Or atleast im pretty sure it is.

So anyone know the equation?

0
Scratch the shader code bit i have no clue if thats the water shader, still my best guess but i have no clue. CodeNil 30 — 8y

Answer this question