Creating textures from Ornate Photos

From The DarkMod Wiki
Revision as of 06:22, 8 December 2021 by Nbohr1more (talk | contribs) (Created page with "DRAFT There are a number of texture creation articles in the darkmod wiki with valuable advise regarding texture design. <br>This article serves to cover a few areas that are...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

DRAFT

There are a number of texture creation articles in the darkmod wiki with valuable advise regarding texture design.
This article serves to cover a few areas that aren't really discussed either due to mappers presuming "a priori" knowledge
or due to lack of knowledge regarding these areas.

The Ornate Photo

This tutorial presumes that we are concerned about creating a texture that illustrates detailed carving or engraving. The subject will typically be a single physical material such as stone or wood. The techniques can be extended to complex multi-material sources but will be far more labor intensive.

As best as possible, try to ensure that the photo of the ornate carving is flat with respect to view perspective. You can correct this a little via the use of rotation and shear translation operations but it is best to start with a texture that is close to orthographic as possible with as little vanishing point distortion as possible.

Also, it is strongly recommended that the photo source be illuminated by a single light source. Ideally it would be lit with uniform diffuse lighting but a moderate strength single directional light also works as long as large portions aren't completely cast by black shadows.

That said, depending on the source photo one could possibly use the lit portions to reconstruct the shaded areas on a larger scale than the technique offered later in this tutorial.

Tuning the photo for Height Map conversion

The dominant tool for generating normal maps from photo sources in the darkmod community is "njob" but other tools such as "Crazy Bump", "Awesome Bump", "Materialize" all seem to use the same design where the heightmap extracted from a texture is inferred by directional shading around features and overall brightness ( AO ) and some percentage of the shading from the original source photo mixed in. There are plenty of ways that this heuristic can go wrong and decide to invert, flatten, or emboss the wrong geometry in the texture. To reduce the chance of these issues, you can tune the image prior to feeding it to njob for conversion to heightmap.

The tuning is done by selectively brightening or darkening areas of the photo so that protrusions are brighter and recesses are darker. There are a number of ways this can be achieved ranging from painting \ airbrushing a transparent bright layer over the image and blurring it, to painstakingly selecting small sections of the image and using the brightness \ contrast color tool to brighten or darken. In my experience, for GIMP the easiest way to achieve good clean results is as follows.

( Remember to keep an unaltered version of the original photo source. )

1) Open the image in GIMP 2) Under Layer create a new layer from visible ( repeat this a few times ) 3) Go to Windows > Dockable Dialogs and open the Layers and Tool Options dockables 4) Determine whether the majority of the geometry needs to be embossed or recessed 5) If the majority needs to be recessed then darken one of the layers with brightness \ contrast and move it above a brighter layer 5a) Use the eraser tool to expose the brighter image underneath wherever you wish to emboss the image. Use the Tool options size and opacity to control how much the eraser exposes 6) If the majority of the image is embossed and a small number of features need to be recessed then reverse the order of the darker and lighter layers in step 5 6a) As with step 5a, use the eraser tool to expose darkened versions of the features you wish to recess 7) If necessary merge the two layers and use yet another layer to repeat a selective brightening or darkening by more eraser tool work 8) Make sure that brightening is faded from the center of protrusions to the edges of them or else they will be flat protrusions in the final results

Now you should have an image where the brightness of foreground objects is slightly exaggerated compared to the background.

9) If the image has directional shadows on the top, bottom or left, rotate the image so that the shading is on the right

Now, when you open the image in njob and go to filters > diffusemap to heightmap the resultant heightmap will be much more accurate to the intended output. Adjust the intended detail ranges as preferred and export the heightmap for later use.

Tuning the Heightmap for Normal Map conversion

The process of converting from photo to heightmap will usually wash out some of the fine details. One way to better preserve the details is to generate an alternate heightmap from the original source image then convert to normal map then heightmap all using the highest detail settings and then blend this high detail AO map over the original heightmap with a layer using color to alpha ( white )

Finally use GIMP again to selectively brighten or darken parts of the image. This time you can be much more aggressive in exaggerating the brightness of protrusions.