sharder

Shader code
shader_type spatial;

uniform float height_scale = 0.5;
uniform sampler2D noise;
uniform sampler2D normalmap;

varying vec2 tex_position;

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

void fragment() {
  NORMAL_MAP = texture(normalmap, tex_position).xyz;
}
Live Preview
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from ozias

guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Berlim
Berlim
7 months ago

displaced terrain effect using vertex displacement and normal mapping?

ColorauGuiyino
7 months ago

Why would you upload a shader without explaining what it does or what it’s for, without even a reference image? Unfortunately, this is becoming more and more common on this page.

TTien63
6 months ago

I want to know what does this thing do bro I confused as heck to this website sometime