Popular Post MJW Posted June 27, 2015 Popular Post Share Posted June 27, 2015 (edited) 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Edited August 21, 2020 by Ego Eram Reputo restored title & location 15 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.