Sign in to follow this  
Followers 0
MJW

Texture Scaler

9 posts in this topic

Texture Scaler is a rather boring but sometimes useful utility program which allows height maps to be rescaled. The height map is mapped to the specified range. The original range is considered to be 0 to 1 if the Pre-Scale Heights to Entire Range option is disabled, and the minimum height to the maximum height within the selected portion (actually its bounding rectangle) of the image if the option's enabled. The Feather Far Pixels option is useful for erasing the zero-height background when combing height maps using the Texture Merger with the Minimum merge method. Unchecking the Produce 24-Bit Height Map option allows it to be used to scale grayscale height maps (and other grayscale images too, I suppose).

 

Here is the plugin: Texture Scaler.zip

 

From the Help Menu:

 

Texture Scaler scales a height map to a specified range.

The controls are:

Pre-Scale Heights to Entire Range: When enabled, the height range is adjusted prior to scaling so that the minimum pixel height is zero and the maximum pixel height is one. Equivalently, the minimum height will be mapped to Minimum Height and the maximum height will be mapped to Maximum Height. When there is an active selection, the pixels within the selection's bounding box will be used to determine the depth range.

Set Height of Transparent Pixels to Zero Before Scaling: When enabled, the height of transparent pixels will be set to zero before mapping to the final range. Equivalently, transparent pixels will be mapped to Minimum Height.

Feather Far Pixels: When enabled, the transparency of scaled pixels near the Minimum Height will be increased.

Feather Height: Specifies the height at which the pixels will begin to become transparent. If Feather Height is less than Minimum Height, no pixels will be modified. If Feather Height equals Minimum Height, pixels whose depths equal the Minimum Height will be made transparent.

Produce 24-Bit Height Map: When enabled, the scaled height map will have 24-bits of precision. When disabled, the scaled height map will be an 8-bit grayscale image.

Minimum Height: Specifies the minimum value for the scaled height map.

Maximum Height: Specifies the maximum value for the scaled height map.

 

The user interface:

TextureScalerUI.png

 

EDIT: Replaced buggy version. Increased slider precision from 2 to 3 places. Changed version to 1.1.*.

6

Share this post


Link to post
Share on other sites

interesting.....  I'll have to keep this around.

0

Share this post


Link to post
Share on other sites

Posted (edited)

Nice...

Edited by Noop
ok then
0

Share this post


Link to post
Share on other sites

It's really only useful for those who use the Texture Shader and Texture Merger plugins a lot. I don't want to be criticized for using "private" plugins for comps, so I try to publish all the plugins I use, and let others decide whether they're worth downloading. For most PDN users, this one won't be.

1

Share this post


Link to post
Share on other sites

Hello MJW,

Can you give example of what is standard result of using it ?

here example of using it on shape of diamond:

First TextureShader with default option with the light from up left ( -150.50.0)

 

image.png

 

 

 

And here the TextureScaler with Min 0.60 and Max 1.0:

 

image.png

 

 

 

 

 

What Now will be the best result ?

 

 

 

0

Share this post


Link to post
Share on other sites

There was rather blatant bug in the scaling, which I fixed. I can't imagine how I missed it. I also increased the slider precision to 3 decimal places. (I hope I didn't miss any other obvious bugs.)

0

Share this post


Link to post
Share on other sites

Shochi, the plugin isn't really intended to produce specific images. It's essentially a brightness/contrast/auto-brightness control for height maps, and is mostly useful in conjunction with plugins which use 24-bit height maps, like the Texture Shader. What's best depends on what the height map will be used for. Because the normal image editing functions can't be used for high-precision height maps, I'm writing some tools to help manipulate them.

0

Share this post


Link to post
Share on other sites

I'll probably point a buddy of mine to it, he uses Anim8or.  He might be able to use it.

0

Share this post


Link to post
Share on other sites

Nice work MJW!  :)

I did a little comparison experiment.  So, it alters the way Texture Shader will 'color' the sphere because you've altered the height map.

Some interesting effects can be achieved with this.

 

Here is a simple example:

 

Texture%20Scaler_various%20settings_01_z

 

 

Thank you MJW!   :beer:  :pizza:

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