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.

DarkBASIC Professional Discussion / Announcing a Perlin Noise Plugin...

Author
Message
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 03:02 Edited at: 7th Oct 2011 02:42
http://forum.thegamecreators.com/?m=forum_view&t=189861&b=18

Generate Terrains, textures, clouds etc with precision, detail, etc...

Source code released: http://forum.thegamecreators.com/?m=forum_view&t=189861&b=18

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Kezzla
17
Years of Service
User Offline
Joined: 21st Aug 2008
Location: Where beer does flow and men chunder
Posted: 29th Sep 2011 08:31
Awsome man, thankyou for sharing.
I've been trying to work on a perlin noise generator for a while now.
Amazing how such a simple concept can be such a nightmare to code.

I'm still hell bent on doing it myself (worked this hard for this long and i'm not gonna let it beat me now)

but at least til then I can use your generator so I can work on other aspects of my project.

good stuff man, again thankyou

kezzla

Sometimes I like to use words out of contents
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 13:18
@Kezzla - Cheers It took me some figuring out to get it to work too. Good luck with yours.

I did actually try converting the code to just DBPro with no success so after a few optimizations to the C++ code (turning it into ASM) I turned it into a plugin.

Warning! May contain Nuts!
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 29th Sep 2011 22:58
I've implemented my own Perlin Noise system using Darkbasic Pro commands but would be interested in trying this out if it would provide an increase in speed. I've not used any DLLs before so I don't know if they provide some advantage over having the code directly in the program. Any thoughts on this?
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 29th Sep 2011 23:15
Generally there is a slight increase if not more when anything is coded in C++. In the perlin noise plugin I've converted some of the intense and mostly used functions directly into assembler code, ie Noise and Interpolate. These two now actually use the FPU for all it's math instead of a built in function, even down to Cosine and the number 1.0. The DBP version now runs just as fast as what it would do in just C++ with these changes.

I did try converting the perlin noise to DBPro sometime ago (about two months), but whatever wasn't working at the time I couldn't find it and eventually went back to my C++ code.

As far as I know the plugin itself is compiled along with your program if it uses it. This plugin as it stands (er, give me a sec), 12.5k (Wow, I will have to reduce that!). That will get attached to your exe without the need to copy it.

Most of my programming is in C++ anyway but with the amount of help I've had from the community to date, my code will be released anyway.

Tonight I am considering changing the internal maths to single precision floats to give it another speed boost. Depends on my brain cell though.

I'm also aware of other noise algorithms which I'm thinking of implementing into the plugin or a separate one, such as the diamond-square, etc.

All in all, a plugin written directly in C++ will improve on speed of execution, mine has even been updated by the use of conversion of some functions into assembler.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
CumQuaT
AGK Master
16
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 30th Sep 2011 03:07
Fantastic! Something has has been MUCH needed here! Well done!

Malevolence: The Sword of Ahkranox
www.msoa-game.com
www.facebook.com/malevolencegame
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 30th Sep 2011 13:10
@CumQuaT - Cheers. I'll have to get the additions done very soon and get some more examples out.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 30th Sep 2011 20:31
@WLGfx

Thanks for the response! I'll definitely be bookmarking this
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 30th Sep 2011 20:44
Cool...

I've updated the plugin and added some helper functions to return bytes 0-255 instead of floats -1 to 1...

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 7th Oct 2011 02:43
Source code released: http://forum.thegamecreators.com/?m=forum_view&t=189861&b=18

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2026-07-11 02:55:41
Your offset time is: 2026-07-11 02:55:41