Not Combining Textures: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
RSoul (talk | contribs)
No edit summary
RSoul (talk | contribs)
Replaced content with "{{important|headline=WARNING|text=This tutorial was written under the incorrect assumption that normal maps from multiple materials could be layered and masked like diffus..."
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{tutorial-textures|tutorial-materials}}
{{important|headline=WARNING|text=This tutorial was written under the incorrect assumption that normal maps from multiple materials could be layered and masked like diffuse/specular textures. However, with normal maps, certain colour values are not correct, so it is better to find another way to regenerate them, e.g. with a 3D object program or by making your own greyscale heightmap}}
 
== Introduction ==
 
This tutorial explains how to make new textures by combining parts of existing TDM textures, including their normal and specular maps (plus any other components of the material). This can prove easier than starting the whole endeavour from scratch. Normal maps can be harder to create than diffuse and specular, so the technique mentioned here can save a lot of effort.
 
Example: You may want smooth metal with rust, and some rivets in very specific places.
 
== Prerequisites ==
Intermediate knowledge of GIMP/Photoshop etc (including layers, masks, and different brush types).
 
Basic understanding of diffuse, normal and specular maps (i.e. what each of them is for).
 
It may help with searching to have all of TDM's textures and material files extracted somewhere (but not to your main TDM folder unless you know the consequences). The textures are in the tdm_textures_... pk4 files. The materials are in tdm_models_decls01.pk4. Alternatively you can scroll through the Materials in DarkRadiant.
 
== Preparation ==
 
(This uses the example mentioned in the introduction)
 
Find a smooth metal diffuse texture. Search the material files to find what normal and specular maps it also uses. Load each of these into a single image as separate layers.
 
Find a texture which is only rust (e.g. metal\flat\solid_rust03). Use the material files to find its normal map (this one does not have a specular map).
 
Something similar will be needed with the rivets textures, but it's best to leave them till later.
 
Some images may be different sizes, so it's best to pick one size and make them all equal.
 
You should now have a set of layers like this:
 
[[File:layers.jpg|200px]]
 
''It's best to arrange the layer order into diffuse, normal and specular.''
 
== Processing 1 - Rust Diffuse Layer ==
 
{{important|headline=Note|text=For terrain textures, you'll need to ensure the masks are seamless}}
Turn off all of the layers except for the diffuse for the plain metal and the rust.
 
Add a mask to the rust diffuse layer, and fill this with solid black to make it fully transparent (it's better to use masks instead of normal erasing because it preserves all of the layer's original colours).
 
To get a light smattering of rust, you need to draw a soft '''white''' wispy pattern '''on to the mask'''. GIMP has several brushes that can make this fairly simple:
 
[[File:gimp_brushes.jpg|200px]]
 
Experiment with brush sizes, types and colour (greyscale) to get a pattern of rust that looks good. Example:
 
Normal view -> [[File:Rust light.jpg|200px]] Mask visible -> [[File:Mask visble.jpg|200px]]
 
For further tweaking, the mask's brightness/contrast can be edited, or you can try more advanced things like levels or curves. The overall layer opacity is also a good thing to try adjusting. E.g. Here is the above with the layer opacity set to 50%:
 
[[File:Layer transp.jpg|200px]]
 
{{important|headline=Note|text=It's better to use masks instead of simple erasing because you can keep all of the layer's original colour information.}}
 
== Processing 2 - Rust Normal Map Layer ==
 
The opacity of the diffuse layer needs to be applied to the rust's normal map so that in game, the rust appears to be much more rough than the surrounding steel.
 
Copy the mask from the rust's diffuse layer, add a mask to the its normal layer, and then paste it. With that layer visible, you should see something like this:
 
[[File:Rust normal opacity.jpg|200px]]
 
''Note that the layer opacity has been reduced to 50% to match the diffuse layer.''
 
When showing the steel normal map, you can just about see the difference between the smooth steel and the rough rust:
 
[[File:Both normals.jpg|200px]]
 
== Processing 3 - Rivets Positions and Sizes ==
 
{{important|headline=Note|text=This part is more complicated, but very rewarding once you get the hang of it.}}
 
Find a rivets diffuse texture, and its normal map. Its specular map can be ignored - it will save effort to make your own after the rivets have been resized and positioned correctly.
 
Paste the two images as separate layers:
 
[[File:Rivets layers.jpg|200px]]
 
You need to think about the rivets' sizes and positions, and how many you want. In this example, only a few will be needed, but their sizes and positions will need to be adjusted.
 
To keep the diffuse and normal layers synchronised, you need to link them (in GIMP the link toggle is next to the visibility toggle):
 
[[File:Linked layers.jpg|200px]]
 
This allows ''basic transformations'' to apply to all linked layers:
 
[[File:Scale down.jpg|200px]]
 
''Scaling down the normal layer also scales down the diffuse layer.''
 
{{important|headline=Note|text=Using the scale and move tools only, it may not be possible to get the rivets' sizes ''and'' positions right. In that situation, focus on the sizes. Individual rivets can be moved in a separate process.}}
 
Use the selection tool to delete the rivets you don't want from both the normal and diffuse layers, and use the Move transformation to move them around:
 
[[File:Delete 1.jpg|200px]]
 
== Processing 4 - Neatening the Rivets ==
Once you're happy with the sizes, neaten them up by smoothly deleting the around their edges. It may be easier to use the erase brush on the normal map, and again on the diffuse map, rather than making both of them have identical opacities or using masks:
 
Erasing the normal map -> [[File:Delete 2.jpg|200px]] Erasing the diffuse map -> [[File:Delete 3.jpg|200px]]
 
== Processing 5 - In-Game Check ==
 
Before doing any further work on the rivets, see how the current material looks in game (or in a 3D object program if you're making a model).
 
 
=== Processing 5 and a half - Moving some Rivets ===
 
If you want to move some rivets, but not all of them, you can still use the Transform tools and linked layers, but you have to transfer them to new layers, (diffuse and normal).
 
Use the select tool around the rivet:
 
[[File:Move select normal.jpg|200px]]
 
In GIMP, Press Ctrl-Shift-L to float it, then right click to move it to its own layer:
 
[[File:Move float norm.jpg|200px]] [[File:Move new layer normal.jpg|200px]]
 
 
Repeat the procedure for the diffuse layer:
 
[[File:Move select diff.jpg|200px]] [[File:Move float diff.jpg|200px]] [[File:Move new layer diff.jpg|200px]]
 
 
Turn on the link for these to layers (ensure all others have been turned off) and they can be moved together:
 
[[File:Move both.jpg|200px]]
 
 
Once finished, these two layers can be merged back to their original layers.
 
 
== Processing 6 - Extra Rust - Diffuse Map Layer ==
 
In addition to the light rust that covers the whole texture, it can look good if there are heavier concentrations around rivets or other protrusions, where moisture could be expected to linger, or which be the source of a minor leak.
 
Make a copy of the rust's diffuse layer (which should still have its mask). Reset the opacity to 100%, and fill the mask with black. Move it so it's underneath the rivets' diffuse layer, and use a small, uneven, white brush to draw, in this example, small patches of heavy rust underneath the rivets:
 
[[File:Rusty beards.jpg|200px]]
 
''The advantage of using a new layer is that it can have a different opacity''.
 
== Processing 7 - Extra Rust - Normal Map Layer ==
 
In the same way a normal map was made for the light rust layer, another one has to be made for the extra rust layer. Copy the rust normal map (assuming it still has its mask). Copy the mask from the new diffuse layer and apply it to new normal layer:
 
[[File:Rust rivets normal.jpg|200px]]
 
 
The images below show all four diffuse map layers visible, and all four normal map layers visible:
 
[[File:All diffuse.jpg|200px]] [[File:All normal.jpg|200px]]
 
''You should be able to see how smooth metal, light rust, heavy rust and a rivet are all represented on the normal map.''
 
== Processing 8 - Specular Map - Rust ==
 
The plain steel already has a specular map, which is quite shiny. Rust should be very dull, so you need a dark, almost black, specular layer that matches the rust.
 
Turn off all layers except for the rust diffuse layers. (GIMP) Right click in the layer panel and select New From Visibe:
 
[[File:New from vis1.jpg|200px]] [[File:New from vis2.jpg|200px]]
 
 
Lower the brightness so that this is almost black (and desaturate too, if desired):
 
[[File:Black spec.jpg|200px]]
 
 
When the steel diffuse layer is made visible, you should be able to see that there will be no shininess where there is rust.
 
 
== Processing 9 - Specular Map - Rivets ==
 
Copy the rivets diffuse layer, and move place it above all other specular layers. Rename it and increase its brightness:
 
[[File:Rivets spec.png|200px]]
 
''This will make the rivets very shiny, and combined with their normal map they have have a strong 3D appearance.''
 
 
== Tip 1 - Layer Management ==
 
This example has 11 layers. It's a good idea to make use of layer groups for the diffuse, normal and specular images:
 
[[File:Layer group1.jpg|200px]]
 
''This allows you to easily hide a whole set of layers (e.g. specular), and to collapse the 'tree' to make it easier to focus on the other layers.''
 
 
Each time you import a new diffuse texture (or duplicate one, e.g. the rust layers in this example) you'll have to also import a normal and possibly specular map, so layer groups become more and more useful.
 
== Tip 2 - Don't be Destructive ==
 
You can do all the opacity work using an erase brush, but many programs tend to discard a pixel's colour once it has been made fully transparent. Masks are the best way to let you do whatever you want with opacity while guaranteeing the original colours will be retained, so nothing is lost.
 
== Tip 3 - Model Textures ==
 
If you're making a texture for a model, import its UV map to make it easier to position things. E.g. This is for a button texture:
 
[[File:Button uv example.jpg|300px]]
 
''3 Types of rust (including heavy rust around the button), with the UV map making it clear where the rivets should go.''
 
[[File:RedButton1.jpg|300px]]
 
''The model in game. The rivets have a nice 3D look and viewed more closely, the rust is visibly rough.''
 
== Closing Remarks ==
 
The first time you try this, it may take a while, but once you get the hang of it the only challenging part will be when things need to be resized/moved etc.

Latest revision as of 11:54, 20 October 2018

WARNING

This tutorial was written under the incorrect assumption that normal maps from multiple materials could be layered and masked like diffuse/specular textures. However, with normal maps, certain colour values are not correct, so it is better to find another way to regenerate them, e.g. with a 3D object program or by making your own greyscale heightmap