MJW Posted March 15, 2022 Share Posted March 15, 2022 This tutorial is available as a PDF. Click here to View or Download. This tutorial shows how to render a golf ball similar to my Object of the Fortnight entry. As usual, I didn't write down the steps when I made my OOTF entry, so I can't reproduce it exactly. Also, the method used in the tutorial to produce the dimple HM is completely changed from the original method, and I believe, better. First, because I think the dimples are better looking; second, because the method allows more variations, such as different dimple sizes and different smoothing; and third, because it produces a tiled height map that can be used at any size, for any sized object. Another difference is that in this tutorial I only shade the ball with a single light. In my entry I slightly shaded the ball two more times with light from different directions in order to add some detail in the shadows, which otherwise were just gray, with no visible dimples. One light was from almost straight above (I needed to justify the position of the drop shadow somehow!), the other from almost straight below (like reflected light from a table). This can be done simply by duplicating the golf ball height map in other layers, using the Texture Shader to shade with the Directional light in a different position (and no Ambient light), then combining the layers using the Add blending mode. There are other differences between the tutorial version and my OOTF entry because I always apply "post-processing" image adjustments to my OOTF entries, such as tweaking the brightness and contrast, sharpening, and similar things that seem outside the scope of this tutorial. And, of course, the OOTF entry has a drop shadow, which was produced by blurring and adjusting the transparency of a black ellipse. Here is the image the tutorial will generate: THE TUTORIAL (The blue text is explanatory and can be ignored if the only goal is to produce the image. Perhaps it would be best to follow the procedure exactly first, then read the blue comments to understand the reasoning behind it.) Plugins used: Texture Shader, Texture Merger, Texture Scaler, Texture Smoother. I used the same basic method I described in my Texture Merger comments, just with a different texture map: dimples instead of a grid. Pixey made an excellent video showing the basic procedure in an easy-to-follow manner. The tutorial requires a sphere height map. This is a 512x512 sphere height map that I've used a million times. There's no reason to generate one from scratch -- just use this one: There are three phases to creating the golf ball image: making the dimple height map, making the golf ball height map, and shading the golf ball height map. The last two phases rely on the results of the previous phases. I suggest saving the dimple height map and the golf ball height map, though it isn't necessary. If you save them, you can close Paint.NET and resume the next phase later. That might be less intimidating than trying to complete the entire tutorial in one session. The results at the end of each phase can be compared to my version. Because the plugins used have so many controls, I generally list only the controls that aren't at their default settings. However, I list controls which should be returned to their default settings if they were at a non-default setting in the previous step. I put all the copy-to-clipboard steps in bold text, since it's very important but easy to forget. MAKING THE DIMPLE HEIGHT MAP Create a new image with the dimensions with a width of 362 and a height of 209. The image will be white. Invert the color to make it black. Why such an unusual size? I want the width of the canvas to be the square root of three times the height. It turns out that 362/209 is an excellent approximation of the square root of three, with better than five-place accuracy. The error will be a small fraction of a pixel. If you need a larger, more precise map, 989/571 is an even better approximation. Copy the sphere height map to the clipboard. Run the Texture Merger with the listed controls changed from their defaults: Clipboard Image Size: 0.42 Height Merge Method: Maximum Clipboard Height Offset: -0.5 Antialias: Checked Let me explain the goal. I want to do two things: Reduce the size of the spherical height map relative to the canvas, and reduce the slope at the boundary. This accomplishes both at once. The sphere (really, half-sphere) is moved away from the eye-point. The section of the sphere that goes below zero is clamped to zero, which in the height map is black. Therefore, all except the cap that remains above zero disappears: As for the slope, the slope is very large at the boundary of a half sphere. That doesn't work especially well for a golf ball dimple. Even when the height is scaled down, the profile is not ideal. The slope at the edge of the spherical cap is much smaller, producing a better dimple shape. Run the Texture Scaler plugin with the default settings. I believe it's best to have this height map scaled to the full range, which is what the Texture Scaler with the default settings does. One advantage is that if the method for producing the dimple HM is modified, scaling it to the same height will result in fewer changes to the later steps. Another advantage is that the Texture Merger's Clipboard Height Curvature control works better when applied to height maps that cover most or all of the full height range. Now there's a single dimple in the center of the canvas, surrounded by black. The next steps will make it into a height map that when tiled will have the dimples arranged as the centers of a hexagonal grid. Copy the image to the clipboard. Run the Texture Merger. Clipboard Image: Tiled Clipboard Image Size: 1.0 (restored to default) Clipboard Image Offset: 0.5, 0.5 Height Merge Method: Maximum (unchanged) Clipboard Height Offset: 0.0 (restored to default) Antialias: Checked (unchanged) The result should look like this: When used with the Tiled image mode of the Texture Merger, this will produce the desired hexagonal dimple pattern. However the edges of the dimples will be too sharp for a golf ball. They need to be rounded and smoothed. The smoothing is done withe the Texture Smoother, but care must be taken to avoid smoothing near the edge of the canvas, which will not yield the desired result. The solution is to temporarily increase the image size, so the region of interest is away from the canvas edge. Copy the new image to the clipboard. Run the Canvas Size command. Height: 562 Width: 409 Anchor: Middle The exact size doesn't really matter, but it must be large enough that the area that will be in the final dimple HM is away from the edge of the canvas, and an even amount must be added to the height and width so that the middle area remains centered, and not off by a pixel. A hundred pixels on each side works well. Run the Texture Merger. Clipboard Image: Tiled Clipboard Image Offset: 0, 0 (restored to default) Height Merge Method: Clipboard (No Displacement) Antialias: Checked (unchanged) This will produce an expanded version of the dimple map which should look like this: Run the Texture Smoother. Set the Repetitions to 100 (maximum value) Click the Smooth Texture button twice. Click OK to exit Next, the height map will be restored to its original size. Run the Canvas Size command. Height: 362 Width: 209 Anchor: Middle The result should look like this: MAKING THE GOLF BALL HEIGHT MAP Copy the sphere height map to the clipboard and paste as a new image which will become the golf ball height map. Run the Canvas Size command. Height: 600 Width: 600 Anchor: Middle Copy the dimple HM (height map) to the clipboard. Run the Texture Merger on the sphere HM. Clipboard Image: Tiled Clipboard Image Size: 0.1340 Clipboard Image Offset: -0.025, 0.1 Clipboard Image Rotation: 18 Clipboard Image Mapping Method: Surface Offset 1 Merged Height Scale: 255 Height Merge Method: Subtract Scale Clipboard Heights by Clipboard Image Size: Checked (don't neglect to check this one) Clipboard Height Scale: 0.1 Clipboard Height Offset: 0.15 Antialias: Checked The Clipboard Image Offset and Clipboard Image Rotation move the position of the dimples. They can be set to whatever looks good. I set them here to approximately match my original OOTF entry. You may want to enable Shading while setting the controls, to better understand what's going on. You can use the Texture Shader settings from below. Make sure to disable shading before exiting the Texture Merger! The reason for the Clipboard Height Offset is to produce a profile that includes the dimples. The areas of the textured sphere that are beyond the back plane are clamped to zero, and must be made transparent. To do so . . . Run the Texture Scaler plugin with the following changed settings: Pre-Scale Heights to Entire Range: Unchecked (this keeps the sphere height scaling unchanged) Feather Far Pixels: Checked (this makes all the black pixels transparent) The final height map should look like this: SHADING THE GOLF BALL HEIGHT MAP Copy the following image to the clipboard (or create your your own logo for a different brand): (The logo size is 411x340.) The text image was produced by essentially tracing an actual logo with curves, then filling with the Paint Bucket. Not elegant, but the best way I could come up with. Fortunately, the repeated letters saved me some work. I suggest it might be a good idea to use the Hue/Saturation adjustment to slightly increase the lightness of the logo. I kind of think the black text is a bit too harsh, and that a very dark gray -- almost but not quite black -- might look better. Run the Texture Shader with the following non-default settings: Image: Clamped Clipboard Image Size: 0.64 Clipboard Image Mapping Method: Surface Offset 1 Mapping Displacement: 0.015 Texture Height Scale: 255 Ambient Light Color: 80, 80, 80 Directional Light Color: 240, 240, 240 Directional Light Direction (Use Outer Ring to Reverse): 0, -120, 32 Specularity: 0.35 Specular Concentration (Exponent): 55.0 Antialias: Checked The Mapping Displacement is only to distort the text a bit to conform to the dimples. If the logo were larger, so it occupied a considerable portion of the ball, it would need to be distorted to appear to be on a sphere. Because of the dimples, setting the Mapping Displacement to 1.0 would not work at all (I suggest trying it to see what I mean). What to do? The solution is to pre-distort the logo by first mapping it onto a smooth sphere with the Texture Shader, but using only ambient lighting. The logo will be distorted, but there will be no shading. The distorted logo can then be mapped onto the golf ball HM using to a low Mapping Displacement setting to make it conform to the dimples. The shaded golf ball should look like the image shown at the beginning of this post. You might want to run AA's Assistant or BoltBait's Feather in order to smooth the edge of the golf ball. There are, of course, many variations that can be made. For instance, the depth of the dimples can be increased or lessened by changing the Clipboard Height Scale or Clipboard Height Curvature in the Texture Merger; the size of the dimples in the original dimple HM can be made larger or smaller; the edges of the dimples can be made sharper or smoother by changing the amount of smoothing with the Texture Smoother. 1 2 2 1 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.