Sepcot

Clouds Plugin

32 posts in this topic

I have finally got around to creating the "Clouds" plugin I promised.

 

Cloud Effect Configuration Dialog (version 1.1):

 

CloudsDemo.png

 

DLL Download Link (version 1.1): <broken link removed by EER> (Unzip - Drop the CloudEffect.dll file into your Paint.NET\Effects folder)

Source Download Link (version 1.1): <broken link removed by EER>

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

 

Download >> CloudEffect.zip
(Note: DLL recompiled by EER from original source on GitHub).

 

Plugin can be found under the Effects > Render > Clouds

Edited by Ego Eram Reputo
Added recompiled DLL & UI image
0

Share this post


Link to post
Share on other sites

Yeah the screenshot is timing out or 404'ing or something

0

Share this post


Link to post
Share on other sites
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

0

Share this post


Link to post
Share on other sites

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.)

0

Share this post


Link to post
Share on other sites

Just had a little play with the effect, you can create some awesome effects using multiple cloud layers! Thanks!

0

Share this post


Link to post
Share on other sites

Here, I posted an example of what the cloud plugin does.

cloudpreviewzn6.th.png

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

0

Share this post


Link to post
Share on other sites

Wow... after trying this you can make some cool effects with it :o :P

Nice work!

0

Share this post


Link to post
Share on other sites

* 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).

* 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...

0

Share this post


Link to post
Share on other sites

This is the best pluginn yet, haha, i love it, expically for things i do... I use it constatly...

Thank you!

0

Share this post


Link to post
Share on other sites

I haven't gotten to try this one yet, new action pack subscription came in a couple weeks ago and i'm waiting to rebuild the computer, but its on my list of going to try soon:)

0

Share this post


Link to post
Share on other sites

I use this plugin quite frequently and I've just noticed the download links are broken, so I'm creating this post in order to fix the problem should anyone else need it. Here's the zipped DLL: <removed>

3

Share this post


Link to post
Share on other sites

Many thanks Max! I'll pop a link into the first post.

 

Edit: what do you know - it's one of my compilations :lol:

1

Share this post


Link to post
Share on other sites

If the source code is available, I wish this could be moved to the Render submenu.

 

EDIT: I see that the head post says that's where it is, but it actually seems to be under the main Effects menu.

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now