C
C#•3mo ago
mmm

What is wrong with my C# Perlin noise generator?

I've been trying to code my own implementation of the Perlin noise algorithm based on this paper: https://www.cs.umd.edu/class/spring2018/cmsc425/Lects/lect13-2d-perlin.pdf However, it ends up producing a weird pattern which is pretty far off the result I was looking for. The image it creates is below. I tried messing around with the noise function and dot product function, but I'm unsure of what is actually going wrong. I suspect that I've made a silly error with the logic behind it, so if one of you could point that out for me then that would be greatly appreciated.
11 Replies
canton7
canton7•3mo ago
$paste
MODiX
MODiX•3mo ago
If your code is too long, you can post to https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code!
canton7
canton7•3mo ago
(text files are pretty rubbish to try and view code on mobile)
FusedQyou
FusedQyou•3mo ago
Same on PC tbh
HimmDawg
HimmDawg•3mo ago
I found it very peculiar, that you are initialising a new Random everytime you are calling Perlin, moving it to class level yields something that looks like noise
No description
canton7
canton7•3mo ago
Good spot!
HimmDawg
HimmDawg•3mo ago
Not 100% sure, why that black spot in the top corner is there now, but I'd guess it's because of the calculation of target cells
canton7
canton7•3mo ago
It still looks suspiciously grid-like, so yeah, I suspect there's something else as well
mmm
mmmOP•3mo ago
Noted, I'll use this from now on. Sorry about that 😅 very good point. Thinking back i dont really know why i made a new one each time, so thank you for pointing that out
mmm
mmmOP•2mo ago
managed to fix it in the end. Here's the code for anyone who could possibly want to do the same.
mmm
mmmOP•2mo ago
results look good ibr
No description
No description
No description

Did you find this page helpful?