# Converting Shader Noise to Stripes

Is it possible to convert noise from a shader into stripes similar to below?

From what I understand you want to add a mathf.clamp to the noise to make it streak. But how exactly do you apply the mathf.clamp? The following code below is what adds the noise and what calculates it’s values. I’m just not sure whether I want to apply the clamp where the noise is added or where it’s values are generated. If anymore code is needed I’ve attached the shader I’m trying to convert to this post. I’m still somewhat new to shaders so any help would be appreciated.

``````            float noise = snoise(IN.uv_MainTex.xy * float2(1024.0 + RandomValue * 512.0, 1024.0 + RandomValue * 512.0)) * 0.5;
finalColour += noise * NoiseValue;
``````
``````        float snoise (float2 v)
{
const float4 C = float4(0.211324865405187,  // (3.0-sqrt(3.0))/6.0
0.366025403784439,  // 0.5*(sqrt(3.0)-1.0)
-0.577350269189626, // -1.0 + 2.0 * C.x
0.024390243902439); // 1.0 / 41.0

// First corner
float2 i  = floor(v + dot(v, C.yy) );
float2 x0 = v -   i + dot(i, C.xx);

// Other corners
float2 i1;
i1 = (x0.x > x0.y) ? float2(1.0, 0.0) : float2(0.0, 1.0);
float4 x12 = x0.xyxy + C.xxzz;
x12.xy -= i1;

// Permutations
i = mod289(i); // Avoid truncation effects in permutation
float3 p = permute( permute( i.y + float3(0.0, i1.y, 1.0 ))
+ i.x + float3(0.0, i1.x, 1.0 ));

float3 m = max(0.5 - float3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);
m = m*m ;
m = m*m ;

// Gradients: 41 points uniformly over a line, mapped onto a diamond.
// The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287)

float3 x = 2.0 * frac(p * C.www) - 1.0;
float3 h = abs(x) - 0.5;
float3 ox = floor(x + 0.5);
float3 a0 = x - ox;

// Normalise gradients implicitly by scaling m
// Approximation of: m *= inversesqrt( a0*a0 + h*h );
m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );

// Compute final noise value at P
float3 g;
g.x  = a0.x  * x0.x  + h.x  * x0.y;
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
return 130.0 * dot(m, g);
}
``````