Paint.NET

Welcome to the Paint.NET forum!
It is currently Sun Nov 22, 2009 10:46 am

All times are UTC


Forum rules


Questions or problems with plugin installation? Click here.



Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Clouds Plugin
PostPosted: Tue Sep 12, 2006 9:05 pm 
Offline

Joined: Mon Jul 17, 2006 8:10 pm
Posts: 67
Location: Chicago
I have finally got around to creating the "Clouds" plugin I promised.

Cloud Effect Configuration Dialog (version 1.1):

Image

DLL Download Link (version 1.1): http://www.sepcot.com/files/coding/PaintDotNet/CloudEffect.zip (Unzip - Drop the CloudEffect.dll file into your Paint.NET\Effects folder)

Source Download Link (version 1.1): http://www.sepcot.com/files/coding/PaintDotNet/CloudEffectSource.zip

Edit: Updated to version 1.1

Changes made (v1.1):
    1. Added random numbers to the dialog box for the user to set if they like.
    2. Set default random numbers - same cloud pattern will appear with each invocation (until reseeded)
    3. Moved the GUI around - simple options at the top to more advanced at the bottom
Left to do:
    1. Optimize the noise function


Last edited by Sepcot on Fri Feb 15, 2008 3:05 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 9:15 pm 
Offline
User avatar

Joined: Wed Nov 30, 2005 11:40 pm
Posts: 1267
Location: Middle Tennessee
Nice! Thank you oh so much.

_________________
Image
Kitteh all growed up :_(


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 9:16 pm 
Offline
User avatar

Joined: Tue Jul 25, 2006 10:12 pm
Posts: 3118
Location: Rochester, NY
Awsome!!!!

_________________
Image
Take responsibility for your own intelligence. ;) -Rick Brewster


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 9:46 pm 
Offline
User avatar

Joined: Fri May 12, 2006 6:49 pm
Posts: 1134
Location: Leiria, Portugal
Could you tell me what do the values do?

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 12, 2006 10:58 pm 
Offline

Joined: Wed Mar 08, 2006 3:58 am
Posts: 362
Someone post a screenshot!

_________________
Image
I built my first computer at age 11!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:18 am 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 8878
Location: Kirkland, WA
Yeah the screenshot is timing out or 404'ing or something

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Paint.NET Search Engine: http://searchpaint.net

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:20 am 
Offline

Joined: Mon Jul 17, 2006 8:10 pm
Posts: 67
Location: Chicago
trickman wrote:
Could you tell me what do the values do?


These values are inputs to a Perlin Noise function which generates psudeo random values that determine the look of the clouds.

Frequency gives you number of noise values defined between each 2-dimensional point.

Persistence is a constant multiplier adjusting our amplitude in each iteration.

Octaves define the number of iterations over the noise function for a particular point. With each iteration, the frequency is doubled and the amplitude is multiplied by the persistance.

Amplitude is the maximum value added to the total noise value.

Those variables act within the perlin noise function to generate a cumalative total. There are two other user adjustable variables that act upon the total after the noise function that help in defining the finished look of your scene.

Cloud Coverage is a constant that gets added (or subtracted) to each total. The default value is zero, meaning that the total should not be altered. Adding values will increase the size of the clouds, while subtracting will reduce them.

Cloud Density is a constant that gets multiplied with the total to increase or decrease the apparent thickness of the clouds. The default value is 1, meaning the total should not be altered. Any number between 0 and 1 will reduce the apparent density (making the clouds appear more like fog).

More information on the Code Lab implementation can be found in my blog entry at: http://www.sepcot.com/blog/2006/08-2006-PDN-PerlinNoise2d.shtml


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:28 am 
Offline

Joined: Mon Jul 17, 2006 8:10 pm
Posts: 67
Location: Chicago
Rick Brewster wrote:
Yeah the screenshot is timing out or 404'ing or something

I have some sample images on my Code Lab post here: http://paintdotnet.12.forumer.com/viewtopic.php?t=1971


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 1:30 am 
Offline
Paint.NET Lead Developer
User avatar

Joined: Tue Jul 19, 2005 6:22 pm
Posts: 8878
Location: Kirkland, WA
A couple of things, from looking at the source code:

* You should probably put the random seed values r1, r2, and r3 into the token. You cannot assume that your configuration dialog was ever called before your Effect, and it looks like you're relying on it to set these values. For example, if I'm using this effect outside of Paint.NET, or if I'm relying on the Effect->Repeat... menu item, your configuration dialog will never have existed and these values will be 0 and we'll have some (presumably) boring looking clouds.

* The "Random" class, from what I recall, is not thread safe. You can work around this by putting the [ThreadStatic] attribute on it. For performance sake, only retrieve this field once in your Render() method and store it into a private method variable. You can check out our Add Noise effect's code to see what we do here. (By the way I'm serious about the performance -- performance went up 10x with the retrieve-the-field-once optimization.)

_________________
The Paint.NET Blog: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html
Paint.NET Search Engine: http://searchpaint.net

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 2:52 pm 
Offline

Joined: Mon Jul 17, 2006 8:10 pm
Posts: 67
Location: Chicago
Thanks Rick, I will take a look at my code and see what I can do.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 10:03 pm 
Offline
User avatar

Joined: Fri Jul 07, 2006 2:00 am
Posts: 45
Just had a little play with the effect, you can create some awesome effects using multiple cloud layers! Thanks!

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 13, 2006 11:52 pm 
Offline

Joined: Wed Mar 08, 2006 3:58 am
Posts: 362
Here, I posted an example of what the cloud plugin does.

Image

Edit: I added the blue gradient in the back so the clouds are more clear if you didn't know.

_________________
Image
I built my first computer at age 11!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 4:47 am 
Offline

Joined: Sun Jul 16, 2006 7:03 am
Posts: 12
Location: Ontario, Canada :D
Wow... after trying this you can make some cool effects with it :o :P
Nice work!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 21, 2006 3:33 am 
Offline

Joined: Mon Jul 17, 2006 8:10 pm
Posts: 67
Location: Chicago
Rick Brewster wrote:
* You should probably put the random seed values r1, r2, and r3 into the token. You cannot assume that your configuration dialog was ever called before your Effect, and it looks like you're relying on it to set these values. For example, if I'm using this effect outside of Paint.NET, or if I'm relying on the Effect->Repeat... menu item, your configuration dialog will never have existed and these values will be 0 and we'll have some (presumably) boring looking clouds.

Fixed in version 1.1 - moved random seed values into the token (and GUI).

Rick Brewster wrote:
* The "Random" class, from what I recall, is not thread safe. You can work around this by putting the [ThreadStatic] attribute on it. For performance sake, only retrieve this field once in your Render() method and store it into a private method variable. You can check out our Add Noise effect's code to see what we do here. (By the way I'm serious about the performance -- performance went up 10x with the retrieve-the-field-once optimization.)

Added [ThreadStatic] to the Random class called when the "Reseed Noise" action is triggered.

I am only calling the Random class once (per click) as of version 1.0. The Noise function in CloudEffect.cs could still be optimized... Looking into it...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 21, 2006 3:35 am 
Offline
User avatar

Joined: Mon Jun 19, 2006 9:11 pm
Posts: 1099
Location: North Eastern, PA
This is the best pluginn yet, haha, i love it, expically for things i do... I use it constatly...

Thank you!

_________________
Image
I'm a cheerleader
I'm a Dancer


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosted by Forumer & phpBB

Get your Forumer™ today!

Adding a forum to your website is a great way to get return visitors.

» Get your own Free Forum!

Terms of Use

Privacy Policy

Report Abuse

Copyright © 2003-2009 Forumer. All Rights Reserved. | Copyright © paint.NET