Sign in to follow this  
Spikehead777

3D Heightmap Plugins v1.0

Recommended Posts

3D Heightmap Plugins v1.0

Made with CodeLab by BoltBait.

Hey all! This is my first plug-in for Paint.NET.

UPDATE: This plug-in has received a much-needed update! New features are listed below, also another plug-in is available!

Diffuse Plug-in (Effects -> Stylize -> Diffuse)

Description:

This plug-in is very similar to Emboss in what it does. What this plug-in does, is it takes the current image as a height map, shines a light on it, and returns the intensity of reflected rays as another image.

Examples:3D Plugins.zip

Various spheres with the diffuse plug-in applied on them. This is demonstrating the full movement capabilities that you have. Notice the center sphere.

lightdemo.png

The above image was rendered 49 times under different settings. Some post processing was applied to create the alpha around each sphere. The center sphere had the light pitch at 90, right above the image. The next series had light pitch at 45. The third series had light pitch at 0, in line with the image. The last outer series had light pitch at -45, underneath the image!

Each sphere in the above image was rendered from this image:

HQSphere.png

It looks a lot like nonsense doesn't it? Maybe this image makes more sense:

LQSphere.png

The former image is really a higher detail heightmap than the latter. To create the latter, I took the red channel of the former image and made it grayscale.

Anything you can draw on Paint.Net will work. (old image)

torus.png

Specular Highlight Plug-In (Effects -> Stylize -> Specular)

Description:

This plug-in is very similar to the diffuse plug-in, but it's different in that it creates a highlight on the image, to give it a shiny effect, almost like gloss or metal.

Highlightdemo.png

That's what a highlight looks like if on a pure black sphere.

Combine this with the diffuse plug-in and you can make many 3d looking objects, even chrome-like!

Chrome.png

Features:

Light source with 360 degrees of movement around and 180 degrees above and (NEW) below the image

Pixel "Scaling" -- If your image comes out too short or too tall along the "Z-axis", you can scale the pixels of your image down, so that the highlights and shadows are balanced.

(NEW) High quality settings allow your image to remain crisp and smooth if a correct type of heightmap is supplied.

(NEW) Added specular highlight plug-in to create specular highlights on a heightmap!

(NEW) The original plug-in (Was Illuminate, now Diffuse) is now much faster than before (I was rendering the whole image for each thread XD...about many times unnecessary. XD).

Seamlessness!

Download now!

3D Plugins.zip

EDIT: CodeLab seems to disallow input of decimal values. This work-around changes the inputs so that it's a percent input, instead of decimal scale input. Not anymore, these plug-ins now has support for 2 decimal places with CodeLab.

I hope that with these plug-ins comes a great contribution to the community.

  • Upvote 1

Share this post


Link to post
Share on other sites

I haven't had a lot of time to play with this one yet, but what I see so far I like.

here is a quick one of a part of a brush I'm currently making.

thumb here full size picture in my gallery page 5

th_flower2.png

Share this post


Link to post
Share on other sites
As much as I like it, this plugin caused my PDN to freeze and so I had to End Task with Windows Task Manager. :(

I have noticed that this plug-in does run a little slow. I don't know if it's because of compiling it in CodeLab instead of using a true compiler. Also, remember that this is my first plug-in using Paint.NET, so some code might not be optimized well. =/ Regardless, I'll see what I can do about fixing and cleaning up the plug-in.

Remember, the bigger the image, the longer processing on that image will take, and that's true for just about any image plug-in.

Share this post


Link to post
Share on other sites

Yay! More C4D work! Thanks a lot for this.

[Edit] Kind of disappointed, the results are rather choppy :( .

[Edit] Starting out big and resizing later seems to work.

Share this post


Link to post
Share on other sites
Yay! More C4D work! Thanks a lot for this.

[Edit] Kind of disappointed, the results are rather choppy :( .

[Edit] Starting out big and resizing later seems to work.

C4D?

Yeah, the results will come out a little hard-ish. One thing is that Paint.NET only really allows 256 different color values (if standard 8-bit grayscale), so you don't get many pixels to work with, and also it returns another 8-bit image as the result.

What I can suggest, is that you either make your image larger, perform Illuminate, and size the image down like you said (which is how modern antialiasing in GPUs work), lower the height scale value (Between 0.01 and 0.2), or blur the image (3-6 gaussian blur kind of looks good).

Also, on a related note, I have found that you can't put in decimal values into the plug-in. It seems CodeLab doesn't allow this. I made a work-around to the plug-in, so those that downloaded the plug-in, please re-download. Instead of a minimum scale of 1 : 1 height change per intensity with the old plug-in, it becomes 1 : 100 height change per intensity. I'll have the work-around uploaded shortly.

Share this post


Link to post
Share on other sites

Also, remember that this is my first plug-in using Paint.NET, so some code might not be optimized well. =/

why dont you release the plugin source so others can help improve it? :D

Share this post


Link to post
Share on other sites

A new version of this plug-in is available, along with another helper plug-in. Read the first post for more information if you haven't already.

(Taken from first post)

Features:

Light source with 360 degrees of movement around and 180 degrees above and (NEW) below the image

Pixel "Scaling" -- If your image comes out too short or too tall along the "Z-axis", you can scale the pixels of your image down, so that the highlights and shadows are balanced.

(NEW) High quality settings allow your image to remain crisp and smooth if a correct type of heightmap is supplied.

(NEW) Added specular highlight plug-in to create specular highlights on a heightmap!

(NEW) The original plug-in (Was Illuminate, now Diffuse) is now much faster than before (I was rendering the whole image for each thread XD...about many times unnecessary. XD).

Seamlessness!

Share this post


Link to post
Share on other sites

When I tried to use these plugins, all I could get was a look that looks like emboss/relief effect. How did you get them to look like the spheres/orbs that you're showing in your examples?

I can't make the black ball with the white shiny hilight on it.

Share this post


Link to post
Share on other sites
Description:

This plug-in is very similar to Emboss in what it does.

That's what the plugin does.

Anything you can draw on Paint.Net will work.

So SpikeHead777 created those images in paint.net and then played with the plugin to create the specular highlights on them.

Share this post


Link to post
Share on other sites

Hmmm...<opens diffuse plugin> 1st color. kewl...woah wait a sec. 2st?! 3st!?! 4st!?!?! ya that needs to be fixed. cool plugin, though :)

EDIT: I was just playing with this plugin for about an hour, but I still can't figure out what settings you change to adjust what and how your original image should appear to get the best results. I'll post some of my results later, but they aren't looking too great.

Edited by pdnnoob

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