Search the Community

Showing results for tags 'height map'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Information
    • Forum Rules
    • Paint.NET Search
    • Official Paint.NET website
    • Help Files (the official paint.net documentation)
  • Paint.NET
    • Paint.NET Discussion and Questions
    • The Pictorium
    • Tutorials - Publishing ONLY!
    • Competitions
    • Plugins - Publishing ONLY!
    • Troubleshooting & Bug Reports
  • Off-Topic
    • Grand Theory of Everything
  • Paint.NET Programming / Development
    • Plugin Developer's Central
    • Preview Center
    • Translation and Localization

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


AIM


MSN


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 7 results

  1. This plugin applies shading to a texture defined by a height map, and also applies various displacement modes to an image that's mapped onto the texture.. The height map is a black and white image. Normally black represents 0 and white represents the maximum height, but this can be reversed. I know there are plugins that do similar things (so you don't need to tell me) but I believe this plugin has more features. It certainly has plenty of controls. The plugin is under "Effects>Height Map>Texture Shader." ("Look for the golden orb!") ============================================================================= The plugin: TextureShader_ver2_3_0.zip ============================================================================= The interface (or as much as will fit) looks like: he controls are: Image: Specifies the source of the image mapped onto the texture. It can either be the clipboard, or a constant color. Pixels outside the image range of the clipboard can be transparent, Clamped, Tiled, or Alternately Tiled. When Alternately Tiled is selected, the tile orientation is reversed for every other tile, so that the tiles match at the edges. The edge pixels are not repeated. When a color is used, the image mapping methods have no effect on the final image. Clipboard Image Size: Increases or decreases the size of the clipboard image. Clipboard Image Offset: Moves the clipboard image relative to the texture. Clipboard Image Rotation: Specifies a counterclockwise rotation angle, in degrees. Clipboard Image Mapping Method: Specifies how the image is mapped onto the texture. The choices are: Surface Offset 1: Uses the height and gradient of the texture to attempt to map the image onto the texture as if it were painted onto the surface. Surface Offset 2: An alternate method of mapping the image as if painted onto the surface. Gradient: The simplest mapping method. Displaces the image in the direction of the gradient, in proportion to the gradient magnitude. Gradient-Z: Displaces the image in the direction of the gradient, in proportion to the product of the texture height and the gradient magnitude. Refraction: Displaces the image as if it were refracted by the texture, in accordance with Snell's Law. The Displacement Scale is proportional to the Index of Refraction Reflection: Displaces the image as if it were reflected by the texture surface. The Displacement Scale is proportional to the distance from the texture to the reflected plane. Because the angle of reflection equals the angle of incidence, points with gradients of more than 45° will not reflect the image and will be rendered as transparent. Reflection (Ignore Height): Displaces the image as if it were reflected by the texture surface, but uses only the gradient, ignoring the effect caused by the texture height. Reflection (with Re-reflection): Applies reflection, but approximates the re-reflection of downward reflection vectors. Faux Reflection: Approximates reflection for gradients of less than 45°, but produces non-transparent pixels for gradients greater that 45°. Faux Reflection (Ignore Height): Applies Faux Reflection, ignoring the effect caused by the texture height. Reflection Map (Equirectangular): Displaces the image as if it were reflected from a sphere surrounding the texture surface. The clipboard image is an equirectangular projection. Normally the width of an equirectangular projection is twice the height, but any image will be scaled to cover the entire sphere when the Clipboard Image Size is 1. The sphere can be rotated using the Clipboard Image Offset and Clipboard Image Rotation controls. The Mapping Displacement is inversely proportional to the sphere's radius. The higher the value, the more the reflection depends on the surface position. When 0, the reflection depends only on the gradient. Large values can result in the texture surface extending outside the sphere, in which case the outside region will be transparent. Gradient Map (Equirectangular): Displaces the image based on the intersection of the surface gradient vector with a sphere surrounding the texture surface. The clipboard image is an equirectangular projection. This mapping method is similar to Reflection Mapping, except the gradient vector is used in place of the reflection vector. Divide Mapping Displacement by Ten: Specifies that the Mapping Displacement should be divided by 10 to decrease the control's range. Mapping Displacement: Controls the amount the image pixels are displaced. The effect depends on the Mapping Method. For most methods, it acts as a general scaling factor, but for Refraction and Reflection it has a specific physical meaning. For some mapping methods, such as reflection, setting this value to 0 does not result in no displacement. Divide Texture Height Scale by Ten: Specifies that the Texture Height Scale should be divided by 10 to decrease the control's range. Texture Height Scale: Increases or decreases the texture height. Texture Height Curvature: Increases or decreases the texture height curvature. Generally, positive values round the texture while negative values steepen the texture. Intensity Increases with Height: Normally black represents 0 and white represents the maximum height. When this control is unchecked, the direction is reversed. Use Alpha from Texture: Selecting this option causes the alpha value of the texture to be multiplied by the image alpha. Otherwise, the alpha value of the texture is ignored. (Use caution in making areas of the texture transparent; many methods that make pixels transparent also modify the color components, which will change the edge gradient.) Ambient Light Color: Sets the color of the ambient light source. Ambient light affects all pixels equally, no matter their orientation. The default color is black (no ambient lighting). Directional Light Color: Sets the color of the directional light. The default color is white. Directional Light Direction (Use Outer Ring to Reverse): Sets the direction of the directional light. The directional light's effect on a pixel is determined by light's direction and the texture's gradient at the pixel. Moving the outer ring to the left side of the control reverses the light direction. Directional Light Intensity: Increases or decreases the intensity of the directional light. The directional light contributes both diffuse and specular (reflected) light. Specularity: Determines the shininess of the surface. Increasing this value decreases the diffuse lighting and increases the specular lighting. Specular Concentration (Exponent): Determines the sharpness of the specular highlights. Higher values produce sharper highlights. Apply Surface Color to Highlight: Normally the specular highlight is the color of the directional light, and does not depend on the surface color. Highlights on colored metal take on the color of the metal. Selecting this option multiplies the light color by the surface color when producing the highlight. Antialias: Specifies that antialiasing should be used. Antialiasing can improve many images, especially when reflection is used. Antialiasing will slow the effect, because many more points need to be processed. Antialias Quality: Specifies the number of samples in each direction per pixel. The total number of samples per pixel is this value squared. In what may to some seem contrary to expectations (but which I think makes sense), the canvas image is the texture map, not the image that's mapped onto the texture. The image to be mapped onto the texture must be in the clipboard. There's also the option of using a color rather than a clipboard image, in which case only shading is applied. Typically, the height map is produced by blurring a black and white image. For example, the MJW in the gold reflection image is blurred text. The height map normally must be black and white. The plugin does not convert color images into intensities. One problem is that for some textures there are obvious "waterlines." This is a result of the very limited precision of the height map when used with the normal black-and-white representation. BTW, the gold refection example was produced by the trick of setting the light colors to a gold color (something like RGB = (255, 190, 0) when at full brightness). If I'd wanted to make the background silver, I could have rendered it with white light. The fact that plugins preserve the settings, including image position, between invocations can be a big advantage when rendering different parts of the image with different distortions, light colors, etc. The texture height map can be 24 bits, consisting of the concatenated RGB components (which is why 8-bit maps must be black and white). Here is a 24-bit sphere height maps: If you use this is a texture, and set the Texture Height Scale to 255, it will produce a very smooth sphere. EDIT: A few suggested changes by Red ochre, and a couple of additional comments abut the reflection example. EDIT: I discovered I forgot to remove some try-catch debug code from the float version of GetSurfaceGradient. Though it shouldn't cause any problems, other than perhaps a slight slow down, I removed it from the posted source code, and will post a new DLL later today. If anyone discovers any spelling errors in the plugin, or has any suggestions for improved wording (or other improvements) for the controls, please let me know, so I can fix them at the same time. EDIT 08 Sep 2016: Release version 2.0.*. Now a Visual Studio project instead of CodeLab. Moved from Distort submenu into new Height Map submenu. Made various cosmetic and functional modifications to the user interface, such as using the Angle Control, and changing the number of decimal places. Made White instead of Clipboard the default Image. Added Texture Height Curvature control. Removed option of offsetting relative to selection instead of window. Added option of reversing Directional Light direction. Added Help menu. EDIT 09: 06 Apr 2017: Release version 2.1.* Mostly cosmetic changes. The interface was modified to look more like the Texture Merger. The Texture Height Scale range was increased. EDIT 10: 11 Feb 2018: Release version 2.2.0 Added Reflection Map (Equirectangular) mapping mode. EDIT 11: 28 Feb 2018: Release Version 2.3.0 Added Gradient Map (Equirectangular) mapping mode. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. Texture Object Rounder converts objects to rounded height maps. It's in the Height Map subfolder. For the most common case of an object that's symmetric about the vertical axis, it produces a height map for the object of rotation. For example, it will convert a filled circle to a spherical height map, a filled isosceles triangle to a conical height map, and a filled rectangle to a cylindrical height map. The plugin (Version. 1.0.6464.41586): Texture Object Rounder.zip The Help Menu description: The UI: An example: Original object: The height map: The shaded height map: ----------------------------------------------------------------------------------------- The initial version is imperfect. The height maps produced are sometimes quite ridgy when shaded. The ridges result from errors in computing the outer silhouette of the object. To produce a smooth height map, the object's edge must be determined with subpixel accuracy. This is accomplished by using the alpha values of the edge pixels. My current algorithm isn't as accurate as I would like. I have some ideas to improve it, but they're somewhat complex. I decided to release the current version, as is. I hope to provide a better version in not too long. The Texture Smoother may help smooth the ridges. The objects to be rounded are normally produced using the Shape and Line/Curve tools. For example, you can draw a shape with the Line/Curve tool, duplicate the layer, horizontally reflect the layer, merge the layers, then fill with the Paint Bucket. Fill with care so that all the interior pixels are filled. A well-antialised edge is necessary for a smooth texture.
  3. This plugin displays and reorients equirectangular images. Equirectangular images are panoramic views, which represent a complete spherical image in longitude-latitude format. The plugin is (perhaps not too sensibly) in the Height Map menu. The plugin DLL (version 1.0.0): Equirectangular Viewer.zip The Help menu description: Equirectangular Viewer projects an equirectangular image onto the canvas, as if viewed through a window, and also allows the orientation of an equirectangular image to be changed. Normally the width of an equirectangular projection is twice the height, but any image will be scaled to cover the entire sphere The controls are: Mode: Specifies the result to display in the canvas. When View Equirectangular Image is selected, the portion of the image within the field of view will be projected onto the canvas. When Transform Equirectangular Image is selected, the image will be transformed into a new equirectangular image, with a different orientation. Get Image From Clipboard: When selected, the image will be taken from the clipboard instead of the canvas. Position Specifies View Center: When this option is disabled, moving the View Position control causes the image to move in the same direction. When this option is enabled, the position of the control indicates the location in the image to position at the center of the canvas. View Position: Specifies the position of the sphere represented by the equirectangular image. View Rotation: Specifies a counterclockwise rotation angle, in degrees. The rotation is centered at the center of the canvas. Field of View: In viewing mode, specifies the angular field of view, measured relative to the canvas diagonal. Sphere Nearness: In viewing mode, specifies the distance to the sphere represented by the equirectangular image. When zero, the sphere is at infinity. Larger values move the sphere closer. Antialias: Specifies that antialiasing should be used. Antialias Quality: Specifies the number of samples in each direction per pixel. The total number of samples per pixel is this value squared. Equirectangular images are widely available on the Internet. Here is a small example: This plugin may or may not be useful to anyone. I wrote it mostly to give myself better insight into some aspects of equirectangular images. The Position Specifies View Center control was added because I wanted the default action of the control to match the similar control in the Texture Shader, but it's sometime useful for the control to specify the region of the map to be located at the center of the final image.
  4. This plugin is meant to work in conjunction with my other Height-Map plugins. It's in the "Effects>Height Map" menu. Here is Version 1.1 of the plugin: TextureMerger.zip The effect works similarly to Texture Shader, except instead of an image in the clipboard, the clipboard contains another height map. The height map in the canvas is combined with the height map in the clipboard in various ways. The default method, and the one it was originally written to do, is to add them. If plugins are rated by the number of controls, this is possibly the best plugin ever. The large number is necessary because there are so many things that need to be controlled: the window height scaling and offset, the clipboard orientation, scaling and offset, and the adjustments to the merged height. There are also controls for shading. Shading does not effect the merged height map, but it's necessary to judge the results. Because there's currently no way to automatically disable the shading before exiting, it must be disabled manually. (unless the shaded image is what is wanted). Fortunately, unlike the Texture Smoother, a mistake can easily be corrected with an Undo, followed by rerunning the Texture Merger. Here is the user interface (hide the eyes of sensitive children): According to the Help Menu: ---------- Texture Merger combines two height maps, one in the canvas and the other in the clipboard. Each height map consists of an 8-bit alpha channel and a 24-bit depth, formed by combining the RGB channels into a single 24-bit unsigned integer. The controls are: Clipboard Image: Specifies how pixels outside the clipboard boundaries are treated. Pixels outside the image range of the clipboard can be transparent, Clamped, Tiled, Alternately Tiled, or Brick Tiled. When Alternately Tiled is selected, the tile orientation is reversed for every other tile, so that the tiles match at the edges. The edge pixels are not repeated. When Brick Tiled is selected, every other row is offset by half the image width. The rows do not wrap from the top to the bottom. Clipboard Image Size: Increases or decreases the size of the clipboard image. Clipboard Image XY Proportion: Changes the XY proportion of the clipboard. Moving the control right increases the X size while decreasing the Y size. Moving the control left decreases the X size while increasing the Y size. Clipboard Image Offset: Moves the clipboard image relative to the canvas image. Clipboard Image Rotation: Specifies a counterclockwise rotation angle for the clipboard image, in degrees. Clipboard Image Mapping Method: Selects the method used to displace the clipboard image based on the canvas heights. (A number of methods are allowed which have no obvious physical meaning when merging height maps.) The choices are: No Displacement: Does not displace the clipboard image. Surface Offset 1: Uses the height and gradient of the canvas height map to attempt to map the clipboard image onto the canvas height map as if it were painted onto the surface. Surface Offset 2: An alternate method of mapping the clipboard image as if painted onto the surface. Gradient: The simplest mapping method. Displaces the clipboard image in the direction of the gradient, in proportion to the gradient magnitude. Gradient-Z: Displaces the clipboard image in the direction of the gradient, in proportion to the product of the canvas height and the gradient magnitude. Refraction: Displaces the clipboard image as if it were refracted by the canvas height map, in accordance with Snell's Law. The Displacement Scale is proportional to the Index of Refraction Reflection: Displaces the clipboard image as if it were reflected by the canvas height map surface. The Displacement Scale is proportional to the distance from the canvas height map to the reflected plane. Because the angle of reflection equals the angle of incidence, points with gradients of more than 45° will not reflect the image and will be rendered as transparent. Reflection (Ignore Height): Displaces the clipboard image as if it were reflected by the canvas height map surface, but uses only the gradient, ignoring the effect caused by the canvas height. Reflection (with Re-reflection): Applies reflection, but approximates the re-reflection of downward reflection vectors. Faux Reflection: Approximates reflection for gradients of less than 45°, but produces non-transparent pixels for gradients greater that 45°. Faux Reflection (Ignore Height): Applies Faux Reflection, ignoring the effect caused by the canvas height height. Divide Mapping Displacement by Ten: Specifies that the Mapping Displacement should be divided by 10 to decrease the control's range. Mapping Displacement: Controls the amount the clipboard heights are displaced. The effect depends on the Mapping Method. For most methods, it acts as a general scaling factor, but for Refraction and Reflection it has a specific physical meaning. For some mapping methods, such as reflection, setting this value to 0 does not result in no displacement. Divide Merged Height Scale by Ten: Specifies that the Merged Height should be divided by 10 to decrease the control's range. Merged Height Scale: Increases or decreases the height of the merged height map. The scaling affects the amount of displacement and the effective height for shading. Only the change in displacement changes the values in the merged height map. Merged Height Curvature: Increases or decreases the curvature of the merged height map. Merged Height Alpha Source: Selects the source of the alpha values for the Merged height map. The choices are: All Opaque: Make all heights opaque. Canvas Alpha: Use the alphas from the canvas. Clipboard Alpha: Use the alphas from the displaced clipboard. Composite Alpha: Use the composite alpha. This is the sum of the canvas and clipboard alpha minus the product. If either height is opaque, the merged height will be opaque. Height Merge Method: Selects the method used to combine clipboard heights with the canvas heights. The choices are: Add: Add the clipboard height to the canvas height. Subtract: Subtract the clipboard height from the canvas height. Multiply: Multiply the clipboard height by the canvas height. Maximum: Use the maximum of the clipboard height and the canvas height. Minimum: Use the minimum of the clipboard height and the canvas height. Clipboard: Use the clipboard height as displaced by the Mapping Method. Canvas: Use the canvas height and alpha, as modified by the canvas controls and the merged-height controls. Clipboard (No Displacement): Use the non-displaced clipboard height and alpha, as modified by the clipboard controls and the merged-height controls. Make Unmodified Canvas Heights Transparent: Specifies that if the merged height is the same as the canvas height, the merged height should be made transparent. This allows heights modified by the clipboard to be shaded separately from unmodified heights. Canvas Height Scale: Increases or decreases the canvas heights. Canvas Height Offset: Specifies the offset added to the scaled canvas heights. Canvas Height Curvature: Specifies the non-linear adjustment to the canvas heights, which increases or decreases the mid-range values while leaving the end-range values unchanged. This adjustment is applied before the scale and offset. Weight Clipboard Heights by Opacity: Specifies that the influence of a clipboard height on the merged height is proportional to the clipboard height's opacity. In particular, transparent heights are are ignored, and the canvas heights are used as the merged heights. This control is especially useful when offsetting the clipboard height in when the Height Merge Method is Maximum or Minimum. Invert Clipboard Height Range: Specifies that white clipboard pixels are 0 height and black clipboard pixels are maximum height. Scale Clipboard Heights by Clipboard Image Size: Specifies that the clipboard heights should be scaled to be proportional to the clipboard image size. Divide Clipboard Height Scale by Ten: Specifies that the Clipboard Height Scale should be divided by 10 to decrease the control's range. Clipboard Height Scale: Increases or decreases the clipboard heights. Clipboard Height Offset: Specifies the offset added to the scaled clipboard heights. Clipboard Height Curvature: Specifies the non-linear adjustment to the clipboard heights. Antialias: Specifies that antialiasing should be used. Antialiasing will slow the effect, because many more points need to be processed. but will often significantly improve the results.. Antialias Quality: Specifies the number of samples in each direction per pixel. The total number of samples per pixel is this value squared. ----------The following controls effect only the shaded image.---------- Show Shading (Disable Before Exiting): Specifies that the shaded height map should be shown instead of the actual merged height map. This must be disabled before exiting the effect in order to save the merged height map. Ambient Light Color: Sets the color of the ambient light source. Ambient Light affects all pixels equally, no matter their orientation. The default color is black (no ambient lighting). Directional Light Color: Sets the color of the Directional Light. The default color is white. Directional Light Direction (Use Outer Ring to Reverse): Sets the direction of the Directional Light. The Directional Light's effect on a pixel is determined by light's direction and the texture's gradient at the pixel. Moving the outer ring to the left side of the control reverses the light direction. Directional Light Intensity: Increases or decreases the intensity of the Directional Light. The directional light contributes both diffuse and specular (reflected) light. Specularity: Determines the shininess of the surface. Increasing this value decreases the diffuse lighting and increases the specular lighting. Specular Concentration (Exponent): Determines the sharpness of the specular highlights. Higher values produce sharper highlights. ---------- There are several changes from the Texture Shader, most of which I intend to add to the Texture Shader. Inspired by Red ochre, I added a Brick Tiled Clipboard Image option. I didn't include a Reflected Brick Tiled option, because I wasn't sure how useful it would be. Maybe I'll eventually add it. On several slider controls, such as the Texture Height, I added a divide-by-ten option. These are kind of awkward, but almost necessary to support the wide range of height-map heights made possible, especially using the Texture Smoother. Before the Texture Smoother, large height maps were difficult to produce without very noticeable waterlines, making them mostly useless. Some of the slider controls also use a non-linear range. Moving the slider at the low end of the range produces less change than the same movement at the high end. This allows fiver control at the low values. The Clipboard (No Displacement) Merge Method is useful for modifying a height map in the clipboard with no effect from whatever is in the window. I rather expect there will be a few bugs, since there are so many controls, and the interaction between them is quite complex. I'll follow this comment with a few examples of merged height-map images. EDIT: Version 1.1. I explain the changes in another comment.
  5. Texture Scaler is a seemingly boring but quite 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 (version 1.2.6431.28257): TextureScaler.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 Transparent-Pixel Heights to Zero Before Scaling: When enabled, the heights of transparent pixels will be set to zero before mapping to the final range. Equivalently, transparent pixels will be mapped to Minimum Height. Don't Scale Transparent Pixels: When enabled, the heights of transparent pixels are not modified by pre-scaling or by the range scaling. If this option and Set Transparent-Pixel Heights to Zero Before Scaling are both enabled, the heights of transparent pixels are set to zero. Feather Far Pixels: When enabled, the transparency of scaled pixels near the Minimum Height will be increased. Feather Range: Specifies the proportion of the Minimum Height to Maximum Height range that will be feathered when Feather Far Pixels is enabled. When Feather Range is zero, pixels at the Minimum Height are fully transparent and all other pixels are unmodified. When Feather Range is one, the pixel transparency will decrease linearly through the full height range. 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: EDIT: Version 1.1. Replaced buggy version. Increased slider precision from 2 to 3 places. EDIT 8/9/2017: Version 1.2. Fixed various bugs; added "Don't Scale Transparent Pixels" control; Modified feathering control. EDIT 8/10/2017: Version 1.2.6431.28257. Minor change to avoid unlikely problem.
  6. This is a rather specialized plugin. It generates a spherical height map for use with my various height-map plugins. Though it logically fits in the Render submenu, I put it in the Height Map submenu instead, since it's only really useful with those effects. The plugin: RenderSphereHeightMap.zip The UI: As described by the Help Menu: Render Sphere Height Map renders a 24-bit height map for a sphere. The controls are: Sphere Diameter: Specifies the diameter of the rendered sphere. The choices are: 510: Sets the diameter to 510 (so the radius is 255). Minimum Selection Dimension: Sets the diameter to the minimum of the width and height of the selection. Selection Dimensions (Elliptical): Sets the horizontal diameter to the width of the selection and the vertical diameter to the height of the selection. Maximum Sphere Height: Specifies the maximum height of the rendered sphere, relative to the full 24-bit depth range. Feathering Height (If Transparent Background): When used with a transparent background, specifies the maximum height at which the sphere begins to become transparent. Transparent Background: Specifies that pixels outside the sphere should be made transparent instead of black. Here is an example of a 512x512 sphere height map: The Texture Merger plugin allows a height map in the clipboard to be scaled, stretched in X or Y, and to have the depth scaled, so there isn't usually a need to generate new sphere height map when a new size is required. Up to now, I've been using the one I included in my initial Texture Shader comment. (That image was generated with a simpler predecessor to this plugin.) The reason the sphere is scaled to the selection instead of having the size specified is mostly historical. I may decide to change it later, especially if I make this a Visual Studio (instead of CodeLab) plugin, so I can provide both options and disable the inapplicable controls.
  7. Height maps, as used by my Texture Shader plugin, are typically black and white images, where the height corresponds to the intensity. Because there are only 256 intensity levels, the height maps are low precision, which often results in image problems, such as wavy "waterlines." The Texture Shader actually supports 24 bit precision, where the depth is represented by the concatenated red, green, and blue channels. Unfortunately, producing the 24-bit height maps isn't easy. That's the purpose of the Texture Smoother. The Texture Smoother attempts to smooth black-and-white height maps into 24-bit height maps. The method is called "Laplacian smoothing," which amounts to repeatedly replacing each depth with a weighted average of the depths in the immediate neighborhood. The plugin joins the Texture Shader in the "Effects>Height Map" submenu. Here is the plugin: TextureSmoother.zip Here is the user interface: As the Help menu says: Texture Smoother smooths a 24-bit height map. Typically, the height map will be originally produced as a gray-scale map, with black pixels representing the lowest values and white pixels the highest. Because there are only 256 different values, the height map is low precision. Texture Smoother applies a smoothing algorithm which modifies each pixel based on nearby pixels. The result is a full-precision 24-bit height map. The controls are: Repetitions: Specifies the number of smoothing passes to perform each time the Smooth Texture button is pressed. Increasing the number of repetitions make the texture smoother, but less like the original texture. Smooth Texture: Initiates the number of smoothing passes specified by Repetitions. Because the texture is not reset when the button is pressed, the button can be repeatedly pressed until the desired smoothness is achieved. Reset Texture: Resets the texture to its initial state. Treat Transparent Pixels as Far (Resets texture if changed): Specifies that all transparent pixels are to be treated as if the 24-bit texture value is zero. If this option isn't selected, the actual pixel values are used. Changing the state of this option resets the texture to its initial state. Don't Move Far Pixels: Specifies that zero-valued pixels are to remain unchanged. This option can be used to prevent smoothing the edge where an object intersects the far plane. The option can be enabled or disabled at any time. This allows a small amount of edge smoothing by performing most, but not all, of the smoothing with the option enabled. Show Shading (Disable before exiting): Specifies that instead of showing the smoothed texture as a colored image (which is usually not too meaningful), the shaded texture should be shown. To preserve the actual texture for later use, this option must be disabled before exiting. All the controls that follow are used only to control shading, and have no effect of the smoothed texture. Show All Pixels as Opaque: The transparency of shaded pixels is normally determined by their alpha values. When this option is enabled, all pixels are shown as opaque. Texture Height Scale: Increases or decreases the texture height. Ambient Light Intensity: Increases or decreases the intensity of the Ambient Light. Ambient light affects every pixel identically, independent of the gradient. Directional Light Direction: Sets the direction of the Directional Light. The Directional Light's effect on a pixel is determined by light's direction and the texture's gradient at the pixel. (The control's outer ring currently has no function.) Directional Light Intensity: Increases or decreases the intensity of the Directional Light. The directional light contributes both diffuse and specular (reflected) light. Specularity: Determines the shininess of the surface. Increasing this value decreases the diffuse lighting and increases the specular lighting. Specular Concentration (Exponent): Determines the sharpness of the specular highlights. Higher values produce sharper highlights. The user interface is slightly unusual in that pressing the Smooth button doesn't start from the beginning image, but instead from the currently smoothed version. I do this because the amount of smoothing required to produce the desired degree of smoothing is quite unpredictable, and over-smoothing can eliminate details. This method allows the user to progressively smooth the texture to the preferred extent. One very inconvenient feature is that in order to judge the smoothing, the Show Shading option must be enabled; but if the option isn't disabled before exiting the plugin, the result will be the shaded texture, not the texture. Unfortunately, there's currently no (allowed) solution to problem, though there may be in the future. If there is, I'll happily change the plugin to use it. The Don't Move Far Pixels option is useful for preventing textures, such as the earring texture below, from spreading out. It can sometimes -- or even often -- produce some undesirable wrinkling at the edge, where the object meets the far background. It often helps to first run a few passes with the option disabled, to smooth the edge boundary. The Treat Transparent Pixels as Far is very useful when the far background is transparent. Most often transparency is represented by "transparent white," which will likely cause problems if this option isn't enabled. I'll show a couple of examples. First a texture intended to represent a gold earring. Here is the original texture: Here is the shaded texture: As is obvious, the shaded version has waterline anomalies. Here is the smoothed texture (which required, I believe, 200 smoothing cycles): Here is the shaded version: Here is a (low-roughness) Cloud image shaded with the Texture Shader: Here is the same texture after smoothing (about 25 smoothing passes):