0 votes

Everywhere I look I see posts on how to generate opensimplex noise within GDScript, but I can't find any on how to generate that noise in a fragment shader. Can anybody help me out?

I would love if somebody could provide just a simple grayscale noise shader using the build in noise function.

asked Apr 19 in Engine by zachThePerson (46 points)

1 Answer

+1 vote
Best answer

Ok, figured it out myself. You have to create a texture uniform, and then in the node inspector you set that to a new noise texture

uniform sampler2D NOISE_PATTERN;

void fragment(){
    float noiseValue = texture(NOISE_PATTERN, UV).x;
    COLOR = vec4(noiseValue);
}

The above will simply sample the noise texture and set the color as the output

answered Apr 19 by zachThePerson (46 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.