Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] Endless animated Perlin Noise clouds

Author
Message
Jukuma
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 18th Feb 2009 01:20
This is an Example how to build a endless animation of clouds
with Perlin Noise.

Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 18th Feb 2009 03:58
This is very cool and opens up many possibilities. I will read through the code with interest! It does seem that the animation is "jerky" - like a series of linear interpolations between points. Perhaps i am seeing things. Will read through and see how it works.

Jukuma
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 19th Feb 2009 02:50 Edited at: 19th Feb 2009 08:55
yes, that is true.
change the step to fade in 64 ...

function MakeFadePal(s)

for x = 0 to 33
for y = 0 to 33
tmp(x, y, 3) = (tmp(x, y, s) - tmp(x, y, 0)) / 64
next y
next x

endfunction

and also in the main loop.
Jukuma
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 11th Mar 2009 21:21 Edited at: 11th Mar 2009 21:44
the perlin source is now coded in assembler. it will be
on runtime a temp.dll created and used. all "set functions"
can also be used in the main loop to change effects.

lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 15th Mar 2009 04:41
i only get 7 FPS, i dont think thi would be ethical for a large and speed needy game...
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 19th Mar 2009 03:33 Edited at: 19th Mar 2009 03:41
The new version loads a lot faster, but runs a lot slower. What has actually changed? Is it computing frames on the fly now? Or does it precompute as before?

If it's the latter, i'm most impressed by the speed increase in the loading, and perhaps should look to use dlls for some of my code. However, i am confused as to why the framerate is so much lower now. What else has changed? Rate of changing the image? The size of the image?

I got 10 fps. WHen set to cosine i got 6fps. This suggests to me that perhaps frames are now computed "in realtime" - if you were just switching through precomputed image frames, then surely the framerates would be the same...

It would be nice to see a direct comparison between the DBP code version, and one using a dll. I'm wondering how much speed difference there actually is.

Jukuma
21
Years of Service
User Offline
Joined: 18th Nov 2003
Location: Germany
Posted: 20th Mar 2009 00:40 Edited at: 20th Mar 2009 01:18
Yes, the new version will calculate the frames in real time.
The two versions can't compare because the dbp version makes
precalculations of each frame. The real frame rate is currently
only doubled to the first version. I will be able to insert
precompute the frames into a avi file.

In the assembler code i work with many real numbers, what the advantage of speed again destroys.

same as dbp code:
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 20th Mar 2009 01:49
This runs at about 3fps for me. So like you say, the "assembler" version is around twice as fast! I guess once you have computed the frames, the end result will be the same framerate, but the loading time would be about half.

Interesting that you mention avi files. Retexturing on the fly can be bad because it causes some internal DBP lists, of textures, or objects or whatever, to be resorted. I hear you can assign a video as a texture. Is this right?

If so, perhaps it is possible to have the video "player" do the interpolation automatically- ie you would just save the "keyframes". I have not used the video commands so don't know if this is possible. Will be interested to see your video code.

BTW what does the // in your code do? Haven't seen that before.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Mar 2009 00:44 Edited at: 22nd Mar 2009 00:45
// is a C-style comment, which is also accepted by DBPro

You can use /* and */ like remstart and remend respectively also.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 23rd Mar 2009 00:33
Thanks dude. Should save me some time writing remstart and remend!

Login to post a reply

Server time is: 2024-11-22 07:26:59
Your offset time is: 2024-11-22 07:26:59