MadJik

Water Reflection (ymd:100725)

189 posts in this topic

Water Reflection Effect Plugin

shell.png

What's this?

This plugin is added to the menu Effects, submenu Distort.

Based on Tom Jackson's Reflection water code lab...

Download it!

Plugin WaterReflection.dll

ar.pngHere is the DLLal.png

The source is available with the plugins package!

http://forums.getpaint.net/index.php?showtopic=7186

How to install

Close Paint.net

Unzip and (re)place the DLL in your Effect folder usually: C:/Program Files/Paint.NET/Effects

The User interface

pdnv330022.png

The settings in the dialog box:

Distance: Where does the water reflection start in % of the height of the image.

Values 0 to 400, default is 50 (middle of the image).

Waves period: This is the wave frequency (not the height but the width amplitude).

Values 0.01 to 100, default is 10.

Duration: The wave is fading slowly while it comes to the bottom of the image. You could change the speed of fading with this slider.

Values 0.01 to 200, default is 100.

Blur: As gaussian blur but done within the same effect.

Values 0 to 10 (very slow!!!), default is 0.

Start Angle: You could move the angle to change a bit the aspect of the wave...

Wind: Add some smooth distort effect.

Values -100 to 100, default is 0.

Distort: Add some strong distort effect.

Values -100 to 100, default is 0.

Second formula: Check this box to use another formula to calculate the wave. It doesn't look like water any more but could give some cool distortions. This formula needs big amounts of "Wind" and/or "Distort".

Distort full height: The effect applies also on the upper part of the image.

Use alpha as horizon: This check box allows you to define the line the water should follow. You create a transparent cut in the image (top=image, bottom=transparent). The water effect will follow the curve of the cut.

A smooth curve gives a better result...

0

Share this post


Link to post
Share on other sites

What is the blur for if we can just gaussian blur it after doing the effect?

0

Share this post


Link to post
Share on other sites
What is the blur for if we can just gaussian blur it after doing the effect?

It was more like coding exercice...

0

Share this post


Link to post
Share on other sites
What is the blur for if we can just gaussian blur it after doing the effect?

It was more like coding exercice...

Mmm, I think you edited it from another dialog... :P

Just kiddin'.

0

Share this post


Link to post
Share on other sites

Nice Lookin Effect Ya got here Madjik, I shall try It Immediately!

0

Share this post


Link to post
Share on other sites

The draw was made after xmas day/night. He's having a bath after a hard time ;)

0

Share this post


Link to post
Share on other sites

I love this plugin! Thanks MadJik.

I used the effect twice in this picture. I used it in the regular way to make the first (foreground) reflection, then I flipped the word vertically and made a second reflection. I used the second reflection to make a watery shadow behind the word.

waterpaintingKORTECKPNG360x240.png

0

Share this post


Link to post
Share on other sites

glad you enjoy it...

Thanks.

I also play with it:

mj007w.png

0

Share this post


Link to post
Share on other sites

Korteck: That's an awesome pic!

I haven't downloaded this one yet...

0

Share this post


Link to post
Share on other sites

Thank you Tinsoldier. :)

You definitely should get this. It's easy to use and good for lots of things besides water.

0

Share this post


Link to post
Share on other sites

My water reflection effect. Implement with lua script on artweaver, not with .net code yet -- Honestly, I have not install paint.dot on this computer, and still have trouble to write the whole thing from loading to save.

I have not apply distortion on y direction. Working on it now, but first want to see if it is necessary.

Right now I got 10 control parameters, have not figure out which is more important yet, still need to try to get rid something not important.

As I feel, it is one of the fastest filter in lua on artweaver, because it just has one loop thru.

Effect with different paramters, which I have not found way or proper name to discribe them.

Edit by Rick: Images removed. They're kinda cool but we don't need 20 pages worth of them.

Now with y distortion, 11 control parameters

weak y distortion factor

Edit by Rick: Images removed. They're kinda cool but we don't need 20 pages worth of them.

0

Share this post


Link to post
Share on other sites
My water reflection effect. Implement with lua script on artweaver, not with .net code yet -- Honestly, I have not install paint.dot on this computer

Yeah, that's nice.

So, what are you doing with Paint.net?

0

Share this post


Link to post
Share on other sites

Yeah, I understand he's not using PDN nor its plugins (only 3 sliders!).

0

Share this post


Link to post
Share on other sites

I am studying .not now, that is the first reason.

I like computer graphics, that is the second reason.

I installed it on another computer, and wish sometimes later I will not need to pivate paintshop pro, therefore I support all good free paint programs (paint.net start slow on this one, therefore I use artweaver, as a comparison, some good freeware painter including:

paint.net

photobie.net --- not tried yet.

paintstar

artweaver

deep paint -- large

gimp

photoplus

Studioline -- large

and the huge ms acrylic preview and graphic designer (not tried)

pixia

graphicgale

photoclinic

photofiltre

As I know, gimp start very slow, then paint.net on this computer, artweaver a little faster but slower than paint.net on the other. The other software nearly same and fast.

I hate pixia's interface. I hate ms' huge size. And photoplus seems have lots of svg component. But the company freeware normally not attractive. They will make it candylike and there will be no improvement for years.

I like to try and see if there is new function or effect in other software. Like photoclinic, they have a swirl distortion that is much clearer than the one in the artweaver.

Last, I once was trying to enter your college:)

I am trying to use the lua to create the dialog for the controls. Artweaver dies or ignores all the time. There is suggestion in lua interface -- syntax error notification! No I have to adjust the parameter by hand:)

I made the first .net paint program yesterday, seems easier than using the openGL and original C graphics. But I still have problems to totally understand madjik's code. Algorithm part is ok, the beginning loops is hard to understand without any context.

0

Share this post


Link to post
Share on other sites
Dude, those are way too big. Just post the thumbnails...

sorry for that, I forget to copy the tb link. and the thumbs look same to me.

Next time I will use smaller images.

Yeah, I understand he's not using PDN nor its plugins (only 3 sliders!).

What is that?

Another control parameter is added to make the interface between water and sky more distinctive.

lotr9az4.th.jpg

lotrawl8.th.jpg

strong effect is x-direction distortion, its power factor

y-direction distortion is not significant.

This is a game of mathematics !! :lol::lol::lol::lol::lol::lol::lol::lol::lol::lol:

0

Share this post


Link to post
Share on other sites
I made the first .net paint program yesterday, seems easier than using the openGL and original C graphics. But I still have problems to totally understand madjik's code. Algorithm part is ok, the beginning loops is hard to understand without any context.

To be honest I'm not understanding all the code too. The fact is the code isn't from me at the begining (plugin template, paint.net source, codelabs codes, etc...)

Trying and testing (and mixing) the code(s) is a (my) way to learn about c#.

a PM discussion I had with a forumer

I'm not C# programer! (yet).

How do I do plugins then?

I know other programing languages and procedural languages (RPG, VB6, VBA,..). I was firstly teached to work with S/36, S/38 then AS/400 (IBM mini systems). Since a while I'm trying to learn about PC world(s)!

Last year I went to MS tech-days for Visual studio and I was told about VS 2005 express (free version of VS 2005). I first get familiar with Visual basic 2005 (by myself). Then I tested Visual Web...

AND.... I was digging in the MS forums for VS when I found a link to PDN !!!!!!!! Free MS-Paint Alternative (or something similar) it was said.

Download and test and press F1 and tutorial and PDN FORUM!!!

On this forum I found a lot of question/answers/discussions/argues/etc...

But I was attracted by the codes I've found on some topics.... Then I tried them with the codelab. It's easy to read for me but I'm still not a fluant writer... So I need a model to be able to code by myself.

The rest is more about logical problems or mathematical functions...

I'm seriously thinking about purchase a book on C# now I could create something...

end of PM

In the codelab we have only one dst/src.

Example (checker.cs from Codelab):

void Render(Surface dst, Surface src, Rectangle rect)
{
   for(int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
           byte c = (byte)(x ^ y);
           dst[x, y] = ColorBgra.FromBgr(c,c,c);
       }
   }
}

For a plugin we have to use a loop like this:

public override void Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, int startIndex, int length) {
 Surface dst = dstArgs.Surface;
 Surface src = srcArgs.Surface;
 for (int i = startIndex; i < startIndex + length; i++) {
    Rectangle rect = rois[i];
  ...

It's like that! it's not my code! And I agree that it's make a bit more complicate to adapt a codelab to be a plugin...

About the First/Second loop: I read somewhere that we should(must) write in the destination image line per line. This is why I thought about a temporary table to "plot" the curves without 'line per line' consideration and a second loop to write correctly in the destination.

This is the main change I've applied in the polygone plugins and it has a big impact in the speed of the rendering...

Regards

0

Share this post


Link to post
Share on other sites

Flatten layers / Duplicate layer / Water effect on the top one.

Or add a layer below as background (underwater?) you want.

0

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