Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Samples a Noise function 3 time to fake a noise based on 3 dimensional.
- // BaseNoise Parmeter: xy are the panning speed of the first two noise sampleing along their uv. z is the tiling of the two sampels
- // timeDistorParameter: x is the tiling of the time distortion sampeling and y is the speed of switching between first sampeling and second samepling
- float Sampelfake3DNoise(const sampler2D noiseTexture, const float3 BaseNoiseParmeter, const float2 timeDistorParameter, const float2 uv) {
- float n1 = tex2D(noiseTexture, uv *BaseNoiseParmeter.z + _Time.yy *BaseNoiseParmeter.xy);
- float n2 = tex2D(noiseTexture, uv *BaseNoiseParmeter.z + float2(0.5, 0.5) + _Time.yy *BaseNoiseParmeter.xy);
- float timeDistoration = tex2D(noiseTexture, uv.xy *timeDistorParameter.xx);
- float t_v = abs(frac(_Time.y*timeDistorParameter.y + timeDistoration * 2. - 1.)*2. - 1.);
- return lerp(n1, n2, t_v);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement