I have found strange behavior programming perlin noise asthis correctly-working OpenGL shader. Code producing Perlin noise:
float left = lerp(fade(v), downleft, topleft);
float right = lerp(fade(v), downright, topright);
float result = lerp(fade(u), left, right);
produces desired effect.
After changing it toThen I tried plugging the definitions of right and left into result:
float result = lerp(fade(u),
lerp(fade(v), downleft, topleft),
lerp(fade(v), downright, topright));
(I only plugged right and left definitions into result)
code Surprisingly, this behaves completely different and there aredifferently, giving visible edges in my perlinPerlin noise. Below are both results:
The woleMy whole 30-line shader(30 lines) is here. I dont want to make this mistake again but still I dont know what
What is the difference beetweenbetween those. Can anybody give me a hint?
By the way I will be happy to hear any remarks on my code as I am new to shader and OpenGL graphics.
Thanks!
