Jump to content

Intermediate Texturing Guide. (Colour, Specular and Normal maps)


Recommended Posts

Intermediate Texturing Guide. (Colour, Specular and Normal maps)

If you want a fullscreen album then here is a direct link to it on Imgur. You can Alt+Tab between the text below and the album if you open the album in a new browser window.

This is a quick a dirty guide about making semi-professional textures that I made for the Open Part Mod.

Not for absolute beginners.

The guide assumes you're familiar with basic 3D and texturing concepts and that you're comfortable with Blender, GIMP and Inkscape or other equivalent programs.

Having said that, I tried to make the guide clear enough so that you can google things if you need to.

Feel free to ask questions, point out errors and share your knowledge to help me improve this guide.

Unwrapping and AO

Image #1

This shows how I unwrapped the spherical tank. A larger number of sections decreases the amount of texture warping, but increases number of texture seams, which can sometimes be problematic. This is personal preference but I think 8 sections is a good balance. Here I've also kept the middle two face loops completely connected and edited those UVs to be a perfect rectangle, in case I want to easily add a horizontal texture later on, like text or a straight line.

This model is unwrapped without any overlap but you can bake AO on models with overlapping UV. Whether or not it looks good depends on two things:

  • Whether the overlapping islands are the same and in the same place, which will happen if you duplicate a mesh. This will allow the AO to look the same for all duplicates.
  • Whether the overlapping islands receive the same ambient light. This means the surrounding geometry must be the same and in the same place with respect to all duplicates. This precludes the AO artefacts which are the result of the program fighting over which light intensity to choose.

 

Both of these must be true if you want good looking overlapping AO.

Keep in mind that overlapping UVs might (depending your your model) make it more difficult to remove texture seams with texture paint.

When choosing your texture size, which can be done at any point before you baking AO, you should keep in mind pixel density. 128px/m is probably pushing the boundaries of what looks good and it's the minimum you should be aiming for. 256px/m is roughly the pixel density of B9 parts and it's a good balance between memory usage and good looking parts.

The pixel density in the example above is a little under 128px/m. This is partly because of the large amount of empty space between the UV islands. You will have a lot of fun optimising texture space usage especially if you decide to keep rings intact. Blender has tools for automatically equalising pixel density and for optimising texture space usage, but it works best with convex UV islands. It will not place smaller UV islands inside enclosed islands like a ring or even concave islands like something in the shape of a "C".

The example above is only one part, but if you have a project with more than one .mu files or parts you can save memory by filling in the unused texture space with UVs from more than one mesh object, but remember that each mesh object in a .mu file can only have one material applied to it. Sharing a texture between meshes can save memory, but doesn't necessarily save HDD space. In order to keep your textures as small as possible in terms of disk space, make sure that the unused space in a texture is all a single colour. This helps with compression of some file types.

You can also see here the Ambient Occlusion map with the settings I used. The default settings make AO really blurred, so I decreased the Attenuation distance to 20cm. I think that's more realistic that way.

The ring tops and bottoms are continuous, again to keep texture seaming to a minimum. It's not the most efficient but it makes for nicer textures.

It's very difficult to predict the amount of time you'll spend unwrapping a model, since it's directly linked to the complexity of the model.

Image #2

This shows the way I've unwrapped that bent pipe section. This way isn't always necessary, but keeping all the UVs parallel and perpendicular allows you do easily make textures that look like they're made of interlocking rings (like those shower head bendy hoses for example). This works best when the pipe was made mathematically perfect, with a bezier curve for example.

Texture foundation

Image #3

I downloaded a scratched metal texture from a free website, and decreased the contrast so it's not as noisy. Disregard AO for the time being.

Image #4

Applying this simple texture results in visible seams. I need to fix this.

Image #5

Doing this requires Texture Paint (or equivalent tool in whatever app you're using).

You need to save your background texture as a copy with a different name. This will be your stencil.

Make sure your base texture is active in the image view window for the mesh you're using.

I've circled the settings that are important to me, but you can experiment.

The Texture in Texture Paint settings should be your stencil texture and NOT your base/colour texture.

Then just paint on the model on the seams using the stencil, and when you're done save the colour texture in your Image view and import it as a layer in your texture source file.

Image #6

No more seams!

Image #7

AO should be a new layer in multiply mode above the base texture. This is the result. A nice foundation.

This took me about 30 minutes, but if you know what you're doing you can do it in 5.

Adding some colour

Image #8

Firstly I need to know where to apply those colour. Blender allows you to export the UV layout in SVG format, which you'll need to open in Inkscape and merge all the objects into one. This can then be imported into GIMP as paths. If you don't merge all the faces in Inkscape then each triangle will be imported as a separate path. You can of course merge various groups of faces into separate objects in the SVG file, and each merged object will be imported as a separate path.

Images #9, #10, #11, and #12

In my experience (and I have no professional training) there are three main way of applying colour to a texture. They are done using the various Layer Modes.

  • Multiply (#9). This is to make an existing texture have a different colour while keeping the the noise underneath similar. This is good for making the texture look like it's made of a particular material, like the copper pipe.
  • Overlay or Hard Light (#10 and #11). This is to make a surface look like it has paint on it. I used this to "paint" the tank grey, and add the stripes.
  • Normal (#12). This is best for adding something that's meant to be a decal, like the warning labels.

 

All of these should be between your AO Multiply layer and your background layer. You can obviously experiment with other layer modes for colours, but I think these three are the most important.

I should mention that the less UV overlap you have, the more varied your texture can be. My way of unwrapping allowed me to add two different warning labels and leave all other sides grey.

Image #13

This is the result. I literally did nothing except what I described here. It's starting to look good, but there are still three main things to do.

This took me a couple of hours but I spent most of that time experimenting with what looks best. If you have everything planned out this can take as little as 15 minutes.

Weathering

Image #14

First I need a stencil with which I'll paint a rough mask. I looked for a metal texture with lots of scratches, and edited it to be greyscale, with a white background and prominent scratches.

All you need to do is desaturate, and adjust levels.

Image #15

Starting with a white background I painted the mask to a new image using Texture Paint as before, very roughly. I fix it later.

Image #16

In GIMP you need to invert it. As a mask, the black parts determine what's invisible, and white determine what's visible. I edited everything to be more subtle in terms of size, dabbed away a lot with a dirt brush and increased the contrast a bit. The resulting mask is applied to a bright metal texture, which is placed right under the AO layer, because the scratches should affect paint and decals.

I keep a backup of the mask because I'll use it later for the specular mask.

Image #17

Result. I'm pretty sure I didn't place the damage in all the right places, but this kind of thing is way beyond me. It would take some kind of simulation to determine realistic damage placement.

This can be done in about 30 minutes conservatively.

Specular Map and Normal Map

This is probably the simplest part of this texture so I did them all in one go.

Image #18

This is the specular map. It's composed of the layers from the colour map. All you need to do is copy all relevant layers, lock alpha of each of the layers and bucket fill each layer with an appropriate grey colour. All colours need to be greyscale. For parts like the copper pipe, I kept the noise, desaturated and adjusted levels. Bright is very reflective, dark is matte.

Image #19

This is the bump map. It is made in the same way as the specular map, except of course colours have to be edited a bit. Bright is high, dark is low.

Image #20

This is the normal map. It is generated from the bump map, I made it subtle because scratches aren't very deep and decals aren't very thick.

Image #21, 22, 23

Maps applied to the model. Colour (#21), colour and specular (#22) and all together (#23).

If you have your layers well made, this can take about 30 minutes I guess.

That's all folks!

If you're going to make an actual part you need to apply the specular map (as a mask) to a merged copy of the colour map and export as an image with alpha. I'm not doing that because that's not the focus of this thread.

Edited by CaptainKipard
Link to comment
Share on other sites

Thanks for the thread. Been using your open source mod post prior as a guide.

Regarding the AO, is there a way to do it so you can still overlap repeated portions to use the same texture islands (end rings, cross-bracing, vertical structural joiners)?

Link to comment
Share on other sites

Thanks for the thread. Been using your open source mod post prior as a guide.

Regarding the AO, is there a way to do it so you can still overlap repeated portions to use the same texture islands (end rings, cross-bracing, vertical structural joiners)?

You can bake AO on models with overlapping UV. Whether or not it looks good depends on two things:

  • Whether the overlapping islands are the same and in the same place, which will happen if you duplicate a mesh. This will allow the AO to look the same for all duplicates.
  • Whether the overlapping islands receive the same ambient light. This means the surrounding geometry must be the same and in the same place with respect to all duplicates. This precludes the AO artefacts which are the result of the program fighting over which light intensity to choose.

Both of these must be true if you want good looking overlapping AO.

Keep in mind that overlapping UVs might make it more difficult to remove texture seams with texture paint, this depends entirely what you mesh looks like but sometimes painting multiple faces at the same time (which you're doing when UVs overlap) can have undesirable consequences.

Edited by Cpt. Kipard
Link to comment
Share on other sites

I just have a simple question: Is there a recommended texture size, or maximum? I'm planning on going with 1024x and hoping that no one will yell at me for using too many resources for a large solar panel.

Link to comment
Share on other sites

I just have a simple question: Is there a recommended texture size, or maximum? I'm planning on going with 1024x and hoping that no one will yell at me for using too many resources for a large solar panel.

Afaik, powers of 2 are easy on the GPU, besides that the size should only depend on the physical size of your model. Something I'm going to start doing (and I'd also recommend) is to keep a 1m3 box in my default blender file, with a colour grid applied to it with a pixel density of 256px/m. This is roughly what B9 parts are (I haven't played KSP in a while, so that may have changed) It's a good enough density as a minimum. With that cube in your scene you can then unwrap your actual models while keeping the pixels looking the same size. You'll need to figure out which size is the smallest that still allows you to keep the pixels dense enough.

Keep your density consistent across the whole model unless you really need some detail somewhere.

So that's the minimum. If you want to go for more HD textures, I wouldn't go more than twice the dimensions (that increases the memory usage four times). E.g. If your smallest texture is 512*512, the next one up would be 1024*1024. Remember to do all your texture work at the highest resolution, and scale down when you're finished.

Edited by Cpt. Kipard
Link to comment
Share on other sites

Documented maximum single texture size for Unity is 4096x IIRC. 1024x is enough for most things in KSP from 1.25 to 3.75m. you can go larger with atlased textures that is shared between different parts, giving you less individual textures to deal with and more visual consistency between parts. Textures do not need to be square; but should be ^2 for each side. for optimal performance they should be ^2 squares.

actual size depends on how big it will be on screen. if the part will be small 90% of the time, go with smaller texture, or sample a section of a larger texture from a larger part. if the part will be huge and take up most of your screen, you'll need bigger texture. 2x the on screen size is good guide for texture sheet size. but even the largest textures will start to blur when you zoom in close enough.

Edited by nli2work
Link to comment
Share on other sites

256px per meter? Oi vey I wonder if I should use a super-powered texture, because I'm making a mega-solar panel. It's going to be comparable in dimensions to the Kerbodyne S3-14400.

I just checked and my Skylon uses a density of about 128px/m Have a look at the screenshots throughout the thread. The fuselage diameter is 5m, and tbh I think it looks fine. There are a few screenshots throughout the thread if you want to judge for yourself. Ignore the video though, because Unity reduces the textures in the preview. I have a total of three 2048*2048 textures and one 1024*2048 texture on the whole thing.

So really the minimum IMO should be 128px/m.

Also if you're not going to bake AO for the panels themselves (which you shouldn't do since they're animated) then you can easily reuse the same part of the texture for multiple areas.

EDIT

This is a close-up shot of the 5m fuselage. 128px/m may be pushing the boundary of what looks good.

XQxz50T.png

Edited by Cpt. Kipard
Link to comment
Share on other sites

I just would like to add, that if there are parts, that don't require much detail and leave unused space, you can create one combined texture for multiple parts, each part has it's own uv-islands. The low-profile engines from "kerbice" use that technique.

I hope that this isn't already in the thread and overread that part. 8[

Link to comment
Share on other sites

After you unwrap it in the normal way that you would a cyllinder, select each row of vertices one by one and scale it down to 0 along its perpendicular axis. Once that's done you can get all the little squares to the same size most easily by scaling the whole island down to a tiny size, selecting "Snap to pixels" and arrange them so they're all 1px in size (or whatever proportion you need). Then deselect "Snap to pixels" and scale the whole thing up again to whatever size you need.

You can sometimes use "Unwrap->Follow Active Quads" to help the process along a bit but that doesn't always work well.

Javascript is disabled. View full album
Edited by Cpt. Kipard
Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks later...

An alternative, possibly easier method for unwrapping pipes is to have them follow a curve. This way, when you want to edit/unwrap/texture the pipe in edit mode, with the curve not applied it will revert back to it's straight position and once you go into object mode, it goes to it's curved position. This makes unwrapping extremely easy.

Link to comment
Share on other sites

  • 6 months later...
Ok, so how would I go about applying these textures in Unity?

http://i.imgur.com/yQv7plG.png

http://i.imgur.com/kswCnrK.png

you got it there. look at the right side (Inspector Panel) in the second image... the last section is the material properties. Some call it "shader" some call it "material"; same thing. you drop the texture into appropriate slots or channels in the shader that's applied to the mesh

_MainTex is your color RGB channel; "Color"; "Diffuse"; "Albedo"... generally the same. This is typically the most basic shader you use. The RGB (spec (A)) tells you it's using RGB for colors; and Alpha channel to control Specular intensity (below).

_Bump is used make the surface appear to have some texture. in games it's generally a Normal map, blue/red/green looking map. You can feed it a b/w map, it's probably converted to a Normal map internally.

depending on how teh shader is built, you can feed it separate map for Specular (simulated shine on polished surfaces); or use the alpha channel from another texture like RGB (spec (A) above.

Specular is a strange beast, it simulates reflection that's in all real world surfaces. It can have 3 aspects, intensity, color, and Shininess (spread), depending on the shader. Intensity is strength of the high light; color changes the color, but the color value interacts with Intensity. Shininess determines whether the highlight has a sharp edge or a soft fall off to diffuse color.

Basic last gen (Xbox 360/PS3) shaders has the above 3 components. Additional channels can control Self Illumination; "glow"; "emissive"; same names; and Reflection either baked or real time.

Physical Based Rendering is the current thing and is pretty different beast since it changes the whole rendering system, we expect/hope KSP with Unity 5 to support that.

Edited by nli2work
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...