Godot docs spatial shader tutorial pt2 - cant get it to work....

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By bingbong

For a noob tutorial (your first shader) its assuming a lot, as it doesnt specify WHERE the lines go or which ones are replaced, however, i think im figuring it out, I have got to the part where (I assume you REPLACE these lines from pt1)

void vertex() {
  vertex_position = VERTEX.xz / 2.0;
  float height = texture(noise, vertex_position).x * height_scale;
  VERTEX.y += height * height_scale;
}

with these lines from pt2

void vertex() {
  vec2 pos = VERTEX.xz;
  float k = height(pos, TIME);
  VERTEX.y = k;
}

but at that point the mesh dissapears from the viewport, adding the next set of the lines from the tutorial make no difference. By the looks of the tutorial, it should animate the water shader at that point, not dissapear. :frowning:

Part 1 does have the completed code at the bottom of the page, but part 2 has nothing of the completed code, so im not sure what the completed one SHOULD look like.

Anyone have the completed code for part 2 tutorial I can look at to see where I have messed up? Or pointers in the right direction?

Ive gone through this tut several times now and am starting to tear hair out!

Thanks in advance!

(edit, the underscores seem to dissapear and italicise the next word in this message window, code is copy pasted from the docs!

(edit, the underscores seem to dissapear and italicise the next word in this message window, code is copy pasted from the docs!

Indent each line of code by 4 spaces to solve this. (I edited your post to do it.)

Calinou | 2020-07-09 07:18