It is currently Sat Jan 18, 2020 9:24 am

Alpha Channels & Texture Tutorials

Come here for tutorials and 3d training. The aim is to point out good 3d training sites or methods.

Moderators :  Winterhawk99, Mermut, Bannor Bloodfist

User avatar
Guest
Part IV continued

Image
This is the texture with the added 'damp' to the base. The gradient texture is obviously only 'tileable' in one direction (horizontally), if the model is higher than the texture can be mapped, you will also need the plain texture above that can be mapped onto the higher parts of the model. The gradient affect is a bit linear and un-natural, but there is a technique for using masks in combination with the render clouds and gradient affects to create much more realistic affects, but this will be dealt with in a later tutorial.

ImageImageImage

The cube above was created in max, and sized as a 400x400x400 cube (a tile is 1000x1000). It then had the various stone textures applied. Example A above used the original stone texture which was mapped as box at UVW map size of 100x100x100. This has resulted in a 4x4 map grid. The mapping pattern affect mentioned above is pretty obvious here, although because each map is only used at 100x100 you could get away with a much smaller texture size (maybe 128x128 instead of 256x256).

Example B uses the amended stone texture with a number of stone coursing blocks on the texture image. This time the texture is mapped as a box with a UVW map size of 400x400x400 (the same size as the cube), the texture is therefore appearing fully on each face (1x1 grid). In this case the texture image size should be kept higher (probably 256x256 minimum) to avoid pixelation at closer views in game.

The texture is still tileable, but shouldn't be as obvious as the example A.

Example C Has the last texture with the gradient affect. This works well in providing added realism, but is not tileable vertically, only horizontally. It can be used in conjunction with the above texture though to create larger constructs. To do this you will have to break objects down into separate meshes at low level which will use this texture instead of the standard stone course one.

End of turtioal 4
User avatar
Guest
Tutorial 6 has also been split up due to the board limitations.
Tutorial 5 was skipped becuase I didn't feel it was a relevent.


Tutorial 6 - Alpha Channels - The Basics

What's an Alpha Channel ?

The first question should probably be - what's a channel ?

What's a Channel ?

Channels are similar to layers in that an image can have a number of channels which can be independently viewed, switched on or off and edited. Like layers, the whole image is actually a combination of the information that is in each of the channels. Each channel is a greyscale 'image' that stores the file's information. A typical image can be made up of a number of channels. Any colour image (even Grayscale images) will have a number of channels by default. The number and type of channel will depend on the colour 'mode' of the image. The most common colour 'mode' is RGB (Red, Green & Blue) where each colour is made up from a mix of red, green and blue. The 'amount' of each of the colours are separated out into the individual channels and represented as an 8 bit grayscale image. The 8 bit limitation means that there are 256 possible values for each of the Channels, normally Red, Green and Blue. This is why when choosing colours you can set the colour value by defining an amount of Red, Green and Blue from 0 to 255. Other colour image formats (CMYK, Lab Colour etc.) have a different channel structure.

Channel information can be viewed in the same tool window as layers. The main layer window has 3 headings layers, paths and channels. If you open an image and check under Channels you should see something similar to the following:

Image
All the channels that affect an image (or the currently selected layer) appear in this list. By default (and assuming the image is RGB) there will be a composite channel RGB, and a channel for each of the 3 colours. You can switch channels on and off in the same way as layers to isolate and view the separate colour information. When you have a single channel isolated it will appear in it's natural greyscale state. For image editing this can be a powerful tool because it allows you to manipulate an individual colour without affecting the whole image - and a lot of standard photoshop tools and filters work on channels in this way - but this is really beyond the scope of this tutorial.

What's an Alpha Channel Then ?

As well as the basic colour channels, you can add new channels to an image. These can be used to store information such as selections, masks and filters. These additional channels are called alpha channels Neverwinter Nights uses an alpha channel to store transparency information for a texture or image. This means that you will need to create an alpha channel and form an image to represent what is transparent (black) and what is opaque (white). If no alpha channel is included in an image, the game will assume that the texture is completely opaque. It is therefore an essential step in creating textures for things like tree canopies, leaves as well as for standard icons for weapons, scrolls etc which all use an alpha channel.

Although Photoshop will allow multiple alpha channels to be added, and for complex image editing you could end up with as many as 24 (photoshop's max), files for export to Neverwinter Nights Must only have a single alpha channel.

Adding alpha channels also increases the file size for an image. A standard RGB colour image has 3 x 8 bits of information, 8 bits for each colour channel. This results in a 24 bit file - 3x8=24. Adding a single alpha channel adds a further 8 bits of information resulting in a 32 bit file. This means when you export a texture that has an additional alpha channel you need to save it as a 32 bit file. This will be dealt with in the next tutorial which shows how to create a simple texture that includes an alpha channel for transparency.

The following shows how you can create a simple alpha channel, and how it can be incredibly useful for storing and editing selection information.

Continue onto Part II of III posts.
User avatar
Guest
Part II continued

Saving a Selection to Create an Alpha Channel

One of the easiest ways to create a quick alpha channel is to make a selection of part of an image with the one of the selection tools. Once you've done this go to Select_Save Selection where you will be prompted to type a name for the selection - make sure you have the New Channel box checked. Photoshop will have stored this selection as an alpha channel. Go to the Layers window and click the channels tab. You should see the 3 main colour channels, plus a RGB total channel at the top. There should also be another channel with the same name as the selection you just made. The selection should be a simple black and white image with white indicating what was selected.

Image
Whenever you reload a previously saved selection, Photoshop simply retrieves the selection information from the alpha channel.

The alpha channel can be edited in the same way as the main image, using paintbrush, gradients, lines etc. and you can also apply various filters. In this way you can edit and control selections in a much more manageable way than simply making selections on the fly. For complex image editing this can be a real benefit and save a lot of time.

Image
Channels can be created in the same way as new layers. The 'page' icon at the bottom of the window will create a new 'empty' all black channel. Using white as your colour you can 'paint' in this channel to create a selection. Make sure you have the channel selected before editing otherwise you may be painting into one of you layers in the main image space. Normally when you create a new channel, the other colour channels are switched off to leave just the new black channel. You can switch the other colour layers back on by checking the 'eye-box' next to the channel name. If you try this you will notice that rather than leave the new channel as black it changes it to red (or whatever colour is set as the default for channels). This is so you can make edits to the new channel while still being able to see the main image.


Continue to part III of III posts
User avatar
Guest
Image
A new 'empty' (black) channel is created.

Image
You can 'paint' into this channel with white to create a selection.
Shades of grey create partially selected areas, works a bit like opacity
in that grey selections will be partly transparent.

Image
When the standard colour channels are switched on, the alpha channel appears red (as default) to make it easier to see.

Image
You can then load a selection from this alpha channel.

To load this as a selection, go to Select_Load Selection and in the drop down menu under Channel and pick the alpha channel that you created. All the alpha channels will appear in this list, and you can store up to 24 separate channels.

This tutorial is really an introduction to channels, there is a whole lot more to them. I use them extensively when doing textures simply because they are so useful for masking parts of images, storing selections and filtering affects. They really come into their own when you want to start blending textures together in a more realistic way. Later tutorials will deal with channels in greater detail, and how to get the most from them.

The next tutorial shows how you need to set up an alpha channel in your texture / image file and how to export it for use with Neverwinter Nights.


The End...
Previous  

Return to The Learning Curve



Users browsing this forum: No registered users and 1 guest
cron