C
C#•4d 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.
9 Replies
canton7
canton7•4d ago
$paste
MODiX
MODiX•4d 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•4d ago
(text files are pretty rubbish to try and view code on mobile)
FusedQyou
FusedQyou•4d ago
Same on PC tbh
HimmDawg
HimmDawg•3d 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•3d ago
Good spot!
HimmDawg
HimmDawg•3d 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•3d ago
It still looks suspiciously grid-like, so yeah, I suspect there's something else as well
mmm
mmmOP•3d 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
Want results from more Discord servers?
Add your server