Noise vertex displacement

Basic vertex displacement shader that uses an OpenSimplexNoise to randomly displace vertices on a plane.

Instructions

  1. Add a new MeshInstance and make it a Plane mesh in the Inspector.
  2. Subdivide the plane by setting Subdivide width and Subdivide depth to 32.
  3. Add a new NoiseTexture to the Displacement shader parameter and add a new OpenSimplexNoise to Noise.
  4. Edit the height with Height Scale.
Shader code
shader_type spatial;

uniform float height_scale = 0.5;
uniform sampler2D displacement;

varying vec2 tex_position;

void vertex() {
  tex_position = VERTEX.xz / 2.0 + 0.5;
  float height = texture(displacement, tex_position).x;
  VERTEX.y += height * height_scale;
}
Tags
displacement, noise, openSimplexNoise, vertex
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 godotshaders

2D wind sway

Cloudy skies

Fireworks

Related shaders

Grass with Screen-Space Displacement

Simple noise overlay

TV noise effect

guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
SamWise
SamWise
1 year ago

This help a lot thanks 🙂 also… do you know how to apply color/texture to this?