Noise Shaper
This is a simple shader for shaping noise or textures by multiplying them against another texture.
I wrote it for use in a procedural generator.
Make sure you put it on a canvas material.
To make use of the resulting texture you will need to put it through a viewport and then: your_Viewport.get_texture().get_image().
To get the attached image I added noise to texture_1 with some color in it’s ramp and then multiplied it by a radial gradient in texture_2 to cut a away the sides making a circle.
Feel free to edit or change. 🙂
Shader code
// CC0, TrevorDane
shader_type canvas_item;
// Since my use is for reading directly from the resulting image for PCG,
// I made the render mode unshaded. If you need it shaded just delete this line.
render_mode unshaded;
uniform sampler2D texture_1 ;
uniform sampler2D texture_2 ;
// To use the following texture slots take the comments them out here and below in // the fragment function.
//uniform sampler2D texture_3 ;
//uniform sampler2D texture_4 ;
//uniform sampler2D texture_5 ;
//uniform sampler2D texture_6 ;
//uniform sampler2D texture_7 ;
// It works by multiplying the textures against each other. You may also try
// other operations. I didn't have much luck with subtraction.
void fragment() {
vec2 color;
COLOR = texture(texture_1, UV) *
texture(texture_2, UV); //*
//texture(texture_3, UV) *
//texture(texture_4, UV) *
//texture(texture_5, UV) *
//texture(texture_6, UV) *
//texture(texture_7, UV) ;
}


