Perlin Clouds

Blitz3D Forums/Blitz3D Programming/Perlin Clouds

MusicianKool(Posted 2010) [#1]
I have made a bit of code for Perlin noise generated Clouds, but I want it to be faster. I'm not sure it can be done but here is the code to help.




Stevie G(Posted 2010) [#2]
Only thing I can suggest is reducing the function calls within the 'Perlin' function - on a large bitmap maybe slower than a week in the jail for what you're doing per pixel.

Do some research - there a much better ways of doing this!!


DareDevil(Posted 2010) [#3]
the system is good ! :)
is slow :|

Good Work


MusicianKool(Posted 2010) [#4]
Thanks DareDevil. I'm trying to figure out how to speed it up, and how to apply it to a Geo-sphere seamlessly. Having problems doing both.


GIB3D(Posted 2010) [#5]
Take one half, of the picture. Flip it, then apply it to the opposite side with a transparent fading-transition-gradient. Do that for each side and maybe it will look seamless. It's just an idea from the top of my head from how I think Paint Shop Pro's seamless tiling system works. Sorry if it's confusing.


MusicianKool(Posted 2010) [#6]
trying something new. so to make the clouds slide i create a bank to store all the random data, then i slide the bank so that a new column of
random data can be entered. Then write it to the screen. but I must not be using copyrect the right way. cause the image isn't moving when copied. The problem is in the cycleperlin function.

edit. Never mind. copyrect does not work in a locked buffer.
Oh crap, I got to redo the whole thing, i Just realized I'm not scaling each octave correctly which changes everything.




Ian Thompson(Posted 2010) [#7]
What Perlin article is this based on, if any, it looks quite interesting?


MusicianKool(Posted 2010) [#8]
I'm using http://freespace.virgin.net/hugo.elias/models/m_perlin.htm as a loose reference.


MusicianKool(Posted 2010) [#9]
Well I got most of it figured out. Still some graphical glitches, When shiftMax# + MinOctaves = MaxOctaves . But overall looks quite good.
If the Image is blank or the sphere is completely blue then re-run the code. not sure why it blacks out some times and not others, something to do with the random numbers it gets from SeedRnd MilliSecs() command. The Shift# variable needs to be in a clock format so that the clouds move smoothly, but I'm not sure how that is done.




Krischan(Posted 2010) [#10]
Search for "Fast Perlin Noise" or "Improved Perlin Noise" in Google.

http://mrl.nyu.edu/~perlin/noise/

http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=263350&reply_id=2889484

I never got it running in B3D but perhaps you're more successful...


MusicianKool(Posted 2010) [#11]
Christian, I got the improved perlin kind of working. not sure if i'm doing it right but it draws something.

Edit: Got it to work a little better.

Edit: Improved Perlin noise Fully working

Edit: Added a z cycle so that you can see morphing noise
Edit: Small speed increase with gradient lookup table
Edit: Added more options to the Perlin2D function




MusicianKool(Posted 2010) [#12]
http://www.blitzbasic.com/codearcs/codearcs.php?code=2706

Improved Perlin noise now in the Code archives.