Sign in to follow this  
Followers 0
MJW

Texture Shader

38 posts in this topic

Thanks MJW The effect is very COOL!  :)

 

cool-4bcc728.png

5

Share this post


Link to post
Share on other sites

Oh, yet another toy to play with! Looks like a busy weekend ahead of me! derisive.gif

0

Share this post


Link to post
Share on other sites

Looks interesting (downloading) - thanks!
Plenty of well annotated code to read through - thanks for that too. ;)

 

ps.

I think it would be useful to state the SubmenuName (Distort) and Pdn version compatibility (Pdn 4 only)?

 

pps.

Work well! ;)
 

0

Share this post


Link to post
Share on other sites

Good plugin. Took a lot of fidgeting, but the end result is good.

 

Gotta have money......

 

wpOhzdm.jpg

3

Share this post


Link to post
Share on other sites

I get an error while trying to compile for PdN 3.5.11. Seems the old CodeLab can't recognize the "Tuple" type or something like that. Would there be a way around this problem?

0

Share this post


Link to post
Share on other sites

I get an error while trying to compile for PdN 3.5.11. Seems the old CodeLab can't recognize the "Tuple" type or something like that. Would there be a way around this problem?

The 3D Roll Control doesn't exist in Paint.NET 3.5x. Sorry.

0

Share this post


Link to post
Share on other sites

I see. Thank you, BoltBait.

0

Share this post


Link to post
Share on other sites

I've downloaded/installed this yesterday and played around a little.

However, I'm sad to say that… I don't get it.

Could somebody please give me a hint about how to use this? I mean, should it be used on the layer with your text? Or above it? Underneath it?

I've figured out that you need to copy your image/texture on the clipboard but I can't get any of these cool result. At best I got the outline of my text with the clipboard image as a background :( Any tip would be appreciated!

0

Share this post


Link to post
Share on other sites

I'm really diggin' this, nice work!!

 

TEXTURETAYLOR.png?raw=1

1

Share this post


Link to post
Share on other sites

Maximilian: I'll try to come up with an alternative for you for the light position using the X-Y control.

 

AgentGoodspeed, open the following image in PDN. Then open any other image and copy it into the clipboard (using ctrl-C). Now go to the MJW image and run Texture Shader. The clipboard image should appear mapped onto the MJW image. You may have to adjust the size of the clipboard image with Image Scale. Adjust the directional light position so the light doesn't come from straight ahead for a more effective image. Set the Image Source to White, and the MJW wil be shaded, with no image.

 

Remember that to a plugin there's only one layer: the current active layer. That's where the texture should be. The only other image is the one in the clipboard. From your description, you may need to do several things. First, as I mentioned, move the light from dead center to upward and off to the side. Second, adjust the texture height. Then try different Mapping Modes. The Reflection modes are the most dramatic, but they're kind of picky, since the reflections may be of the outside transparent pixels. Adjust the Texture Height Scale, Texture Displacement Scale, and Image Scale to deal with that. Tiling will get rid of random remaining transparent pixels. The Faux Reflection and Re-reflection modes won't produce transparent pixels when tiling is used. Antialiasing very often improves reflected images.

 

Adjust the Specularity controls. To me, specularity is the secret sauce to producing cool images.

 

For variety, add a small amount (around 15) of black-and-white (Saturation 0) Noise, followed by a small (Radius 1 to 3) Gaussian Blur. That will make a rough texture. Or use a Motion Blur instead of a Gaussian.

 

Most of the light will probably be Directional, but don't be afraid to add a bit of Ambient Light to fill in the shadows. Using a slightly yellowish Directional Light and a slightly bluish Ambient Light can sometimes give a nice effect.

 

MJWReflectionTexture_zps0wwazf0q.png

Edited by MJW
0

Share this post


Link to post
Share on other sites

Duplicate comment deleted. See following comment.

Edited by MJW
0

Share this post


Link to post
Share on other sites

 Maximilian: Try this. Replace the UI variable line for the directional light with:

Pair<double, double> Amount14 = Pair.Create(0.0,0.0); // Directional Light Direction

 

Then replace GetDirectionalLightDirection (near the end of the code) with:


// Get the direction the directional light is pointing.
float lX, lY, lZ;
void GetDirectionalLightDirection(Pair<double, double> dir)
{
    double x = -dir.First, y = -dir.Second;
    if ((x == 0.0) && (y == 0.0))
    {
        lX = lY = 0.0f;
        lZ = 1.0f;
    }
    else
    {
        // Map the square into a circle by dividing by the distance to the nearest side.
        // In an abundance of caution, very slightly scale down the transformed x and y to avoid the
        // possibility of round-off error causing the square root of a negative number in the z calculation.
        double absX = Math.Abs(x), absY = Math.Abs(y);
        double distScale = 0.999999 * Math.Sqrt(Math.Max(absX, absY) / (absX + absY));
        x *= distScale; y *= distScale;

        // Now the x and y coordinates are within a unit circle.
        // Get the z coordinate from the unit sphere.
        lX = (float)x; lY = (float)y;
        lZ = (float)Math.Sqrt(1.0 - x * x - y * y);
    }
}

I tested it, and it seems to work fine. The control won't be quire as intuitive as the original version, but since you can look at the light in the actual image, it should be serviceable. (Actually, while the control on the left is less intuitive, I prefer the slider controls to the 3D Roll Control equivalents.)

Edited by MJW
1

Share this post


Link to post
Share on other sites

MJW under water (from sig comp):

 

MonochromeSig_zpszorei2yw.png

0

Share this post


Link to post
Share on other sites

Golden "Birthday" (sorry it's so tall):

 

GoldBirthday_zpsd2zeupva.png

Edited by MJW
1

Share this post


Link to post
Share on other sites

Some advice for blurring text. If you want rounded text, just applying the blur will likely produce text edges that won't be crisp enough. Instead (starting with white text on a black background),  first apply a few pixel-width blur. Then select the black area with the Magic Wand. Use Global mode and zero Tolerance so only the absolute black is selected. Invert the selection so the text is selected. Now apply a larger blur. I think that it perhaps works better to consecutively apply several smaller blurs to produce the larger blur. Once the text is sufficiently blurred, Deselect and perhaps apply another blur of a few pixels to smooth the edge transition.

 

Gaussian blur is the standard blur, but other blurs also work well. Applying a 45° Motion Blur followed by a 135° (-45°) Motion Blur seem to produce a good effect.

0

Share this post


Link to post
Share on other sites

Really nice pieces by everyone. Liking everything seen so far! JC_clap.gif

 

I'll be posting a couple of my quick tests later today, but in the meantime I wanted to add to this thread my thanks for the tailor-made alternative source code, comments, and suggestions :) and also the 3.5.11 version of the plugin I compiled, should anyone else want it.

Texture Shader 1.0 for PdN 3.5.11.zip

2

Share this post


Link to post
Share on other sites

MJW, that makes a lot of sense. Thanks!

I guess my problem was that I was working only with text on an otherwise empty layer. But using an entire image really showed me what I was missing. So now I'm off to experiment :)

0

Share this post


Link to post
Share on other sites

Photo carved on a concrete surface:

 

Naty_carved_on_concrete_with_Texture_Sha

 

My avatar eagle sketched on a concrete surface with black chalk, or something like that (original eagle is a pencil sketch scanned and edited with PdN):

 

My_sketch_1_of_eagle_spirit_drawn_with_b

 

My avatar eagle carved on concrete (same concrete texture as above):

 

My_sketch_1_of_eagle_spirit_carved_on_co

7

Share this post


Link to post
Share on other sites

MJW! Thanks for the beautiful plugin. 

 

My final product:

 

zhrevgdt.png

4

Share this post


Link to post
Share on other sites

I only just got around to trying this out.  A very neat Plugin @MJW - thank you.

 

CZqmR8d.png

 

 

 

 

3

Share this post


Link to post
Share on other sites

Thank you, Pixey! I am, I immodestly admit, quite fond of the Texture Shader, and am always pleased to see more people using it, in spite of its somewhat intimidating number of controls.

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
Sign in to follow this  
Followers 0