Textures
From NWN1 Custom Content Guide
Contents |
[edit] Overview
A texture is an image which is applied on the 3D model to give details.
It is used instead of having to model the geometry out, as NWN (as is most video games) are low poly games. It's a fine balancing act between geometry and textures, to get the best effect for your model.
NWN stores textures in 2 methods: as a low res .TGA and a higher resolution .DDS. At the same time, the .DDS is stored in 3 texture packs, one of which is used depending on the amount of video card memory available (16mb or lower, 32mb, and 64mb).
The .TGA textures are stored in:
- /nwn/data/textures_01.bif - creatures, helms, inventory icons, mini-map images
- /nwn/data/textures_02.bif - mostly PC body part .PLTs and inventory icons, portraits
- /nwn/data/aurora_[tilesetname].bif - low res .TGA for the tiles
The .DDS is in /nwn/texturepacks/ in multiple files:
- textures_???.erf - general textures
- tiles_???.erf - for tile related textures
- xp1_tex_???.erf - for XP1, SoU
- xp2_tex_???.erf - for XP2, HotU
The texture pack's suffix relates to the size, TPA for 64mb, TPB for 32mb and TPC for 16mb and lower.
If you wish to editing the texture, ALWAYS grab them from the .DDS, as the .TGA version in the data BIF's are really low res and only there for compatibility with video cards that do not support DirectX 8 and .DDS textures. Use the Extract as TGA feature of NWN Explorer to skip having to extract the .DDS and run it through a .DDS to .TGA converter, as NWE will automatically extract the highiest size out of the .DDS (usually 512x512).
[edit] TGA vs. DDS
- Why DDS over TGA?
- Explain technical differences
- File storage
- How DDS is stored
- Why multiple resolutions
| Resolution | Size | Size w/Alpha |
| 512x512 | 768kb | 1mb |
| 256x256 | 192kb | 256kb |
| 128x128 | 48kb | 64kb |
| 64x64 | 12kb | 16kb |
| 32x32 | 3kb | 4kb |
| 16x16 | 768 bytes | 1kb |
[edit] PLT Textures
PLT textures seem to have been a thing of mystery for some time. The key to understanding how they work rests in appreciating that the whole PLT system is designed to allow you to index into a TGA file that holds a range of colours. This discussion will assume you are working with PhotoShop and the Bioware PLT exporter plugin. This means we will be ignoring the colour channel dance used with utilties like pltcon.
So what is a PLT. It is a file format that holds grey scale images which have been built from collapsing a number of grey scale images. There are up to 10 image layers, which are (starting from the top):
- tattoo2
- tattoo1
- leather2
- leather1
- cloth2
- cloth1
- metal2
- metal1
- hair
- skin
These are the layers you would setup in PhotoShop. Each layer when stored in the PLT references to a palette file in the game. These palette files have strips of colours 256 pixels wide and 1 pixel high. This strip of colour will be refered to as a Row. Each pixel in the Row is a Column. Remember there are multiple Rows in these palatte files.
Now we have some of the basics out of the way. How dow the gray scale layers get their colours when combined into a PLT file and used in game? Easy.
- The layer number tells the game what palette file to use for that layer
- The gray scale values (0 to 255) of the pixels in the layer tell the game what Column offset into the palette file to use
- The colour selection used by the builder in the ToolSet for the body/armour part tells the game what Row offset into the palette file to use
That's it. Essentially the information from the layer number, grey scale data in the layer and the builders toolset colour choices provide 3 dimensional array index data to identify the colour to use when rendered in game.
Some quick HOW to EDIT PLT info with links to plugins:
[edit] PLT EDITING TIPS:
A. BEST WAY
1. Use NWNexplorer to extract old game plts from the texture pack. Assuming you are editing a game plt. If starting a new plt from scratch, set up a 10 layer (order matters grayscale psd (photoshop) file - some tech info is above
2. Use Joco's plt plug in script to convert the old plt (if editing an old one) into the proper 10 greyscale layers used to make the plt - the layers will even be ordered correctly and labeled skin, hair, cloth1, ... through tattoo 2 for you :D http://nwvault.ign.com/View.php?view=other.Detail&id=670 and you will need GIMP (a free paint program) to use this script as sadly James (joco) has never found photoshop script commands that will do this ! LOL Once extracted into layers into GIMP (google for Gimp - its not hard to find) - save the file as a PSD (photoshop)file
3. Open the PSD in photoshop and edit the layers as needed. You can also continue the editing in GIMP but you cannot use biowares export script with GIMP (sheesh - I know...)
4. Get the BioWare plt export script NOTE: it only works with Photoshop but it does work even with the cheep/feebee photoshop elements version. Also it includes a few templates http://nwn.bioware.com/downloads/misc.html and export the new plt. Put the new PLT in a hak if you want to override the original game textures. Note:using the override folder alone does not override original game plt textures but it is fine for new models and such.
B. I don't use this way any more BUT If you don't have Photoshop it works.
1. Same as above 2. Use pltcon to convert to bmp, open in your paint program and convert to RGB color channels then at step 3. continuing using GIMP or other paint program. Set up the color channels correctly, recombine into a bitmap and save, then use pltcon to convert it back to plt. color channel tutorial http://nwvault.ign.com/View.php?view=Other.Detail&id=524 pltcon: see link at very bottom of the page in this link http://www.lordemil.com/NWN/download.htm
C. I never used this method. PLTedit had some problems with plt icon creation especially and was very awkward to use in the garish bmp color system. If the plt editing you plan is very very simple (like changing eyes to tattoo 1 on a face plts or something equally trivial - there is a little simple plt program that edits stuff directly called plt edit http://nwvault.ign.com/View.php?view=other.Detail&id=407 which may work for you. Disadvantage is it only does really simple stuff and Advantage is you don't need any other plugins or paint programs.
Have Fun! Lisa
[edit] TXI
[edit] What is a .txi
A txi is a textfile that executes OpenGL commands on textures to achieve certain effects like the water animation or some spell effects. To make a txi working you simply have to name it the same as the texture you want to apply it to, only change the ending to .txi. (eg: abc01_water.tga/dds -> abc01_water.txi) .
[edit] TXI - Commands
The following is a list of commands you can use within a txi file. Most of this is taken from the Bioware txi document available with the Aura Export Scripts. You can comment out lines by using the # .
[edit] MATERIAL SPECIFIC FIELDS
These fields go in the .txi file for the base texture.
That is, do not specify these fields in the bumpmap
or environment map .txi files - they will be ignored.
|
Specify a bumpmap |
|
Specify an environment map for static geometry. |
|
Specify a blending mode for a material. This blending |
[edit] TEXTURE SPECIFIC FIELDS
These fields are applied to the texture being read in.
Some are specific to different types of textures (like
bump maps) and will be ignored if the .txi belongs to
a texture which is not of the same type. I will try to
document these cases.
|
The default width and height of a texture in the |
|
Specify the procedural type. Only use this if a texture |
|
Create a cycling procedural texture. |
|
Specify how the texture can be downsampled. |
|
Specify whether or not to mipmap the texture. |
|
Specify whether or not to filter the texture using linear |
|
Specify the gamma correction for this filter. |
|
Specify whether or not this texture is a bumpmap. If this |
|
Specify what kind of bumpmapping this bump map will do: |
|
Specify a scaling factor for the bumpmap height. If you |
|
Specify a color for specular bumpmap highlights (RGB). This |
|
Adjust the sharpness of the textures alpha channel (??) |
[edit] GENERAL TEXTURE CONTROLLER SPECIFIC FIELDS
These fields only apply to those textures
which are procedural. If these values are
specified on a non-procedural texture, they will
be ignored.
|
The following two fields specify how a procedure should be |
|
The following field indicates whether or not to distort an |
|
If this value is set to 1, the texture distortion occurs in an |
|
This value indicates how much the texture should be distorted |
|
This value indicates the speed of the procedure. Most procedures |
|
Set the speed of a (cycle type) procedural texture in frames-per-second. |
|
The following two parameters are used for Arturo procedural textures. |
[edit] Tips and Tricks
A good practice would be to ALWAYS work from a high-res 512x512 or 1024x1024 texture, then scale it down prior to releasing it. After all it's easier to lose information than try to create it from nothing when scaling up (reduces blurriness).
Also, when you convert a .TGA to a .DDS, it automatically compresses and creates multiple versions of the texture for either LOD (level of detail) or video card memory capacity. So that 512x512 .TGA sitting at 786kb (or 1mb with an alpha channel) usually compresses to ~300kb as a .DDS. And that .DDS contains the 512x512, 256x256, 128x128, 64x64, 32x32, and 16x16 versions, which would use up over 1.3mb otherwise.
So as you move your camera in and out, the engine will pick the appropriate resolution to apply to the model, so it doesn't stress the video card and CPU trying to scale the 512x512 texture on a model that's 5 pixels wide.
[edit] Tips from Texture Artists
[edit] BatInTheHat
"Plastic wrap is a nice quick way to slime up a texture. dupe your base layer, plastic wrap it with a fairly low smoothness and overlay on top. Also if you use plastic wrap on dirt then overlay it magically turns muddy."
[edit] Ryuujin
"A very VERY good technique is to use greyscale. Paint the whole thing in black and white so you're just painting the light and dark. Create a new layer, set it to "overlay" and then any colours you apply take up the background lighting so you effectivly "colour in" the object. So much easier than painting in colour."
"Packing ice works well for rough painted surfaces, or chitin - when you use "high pass" it forms a mixture of strong ridges, and lesser bumps (Then naturally you use "overlay" as it's render mode)."
"Don't use Paintshop Pro, unless it is the very VERY latest version, Older version cannot export Alpha Maps needed for transparencies and metallics."
"Never use MS Paint, no matter how much "teh l33t" j00 R... *cough* you are"
[edit] Tutorials
- This link isn't for NWN, but it explains nicely to newbies how to apply texture in Gmax : http://airspace.uhk.cz/mlk/msfs/tutorials/gmax/index.html
- This flash movie shows how to create an alpha channel in a .tga : tga_alpha.swf
[edit] Random IRC Quotes
<NexusJnr> holy crap ray just taught me how to do something
<NexusJnr> it works :D
<NexusJnr> cheers ray
<Banter> np
<NexusJnr> now I must kill all people in channel
<Paganini> if you ever need some textures done, hit me up
<ThriKreen> nah, nexus is my whipping boy for that
<Paganini> cool
* RedR offers ThriKreen a brand new whip
<ThriKreen> OoOo +5 vs texture artists!
<batinthehat> oo cool, found a whole pile of old photos of magicians
<ThriKreen> er
<ThriKreen> I'm not going to ask.
<ThriKreen> Like is it "Done By Crayola(tm)" or "batinthehat/nexusjnr" quality? =)
<Dradjeel> who's nexusjnr?
<Dradjeel> and what has he textured?
<Soopaman> wait, Drad wasn't joking when he asked who NexusJnr was?
Main_Page | Textures
