MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
Welshy [Forum]
Sgt.Rampage [Forum]
Rasta [Tutor]
IchKG [Forum]
shivix [Forum]
starkk [Today]
techno2sl [Forum]
andy11cat [Forum]

8 Members and 17 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 29.55%
Multiplayer 62.5%
WHAT!? The tools are out? 7.95%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Appreciation
MODSonline.. Posts: (6) Views: (47) by starkk
Arched window?
CoD:WW Level Des.. Posts: (9) Views: (90) by shivix
nazi_zombie problem with map : (
CoD:WW Level Des.. Posts: (4) Views: (53) by Papik
if your map switches to airfield read this !
CoD:WW Level Des.. Posts: (2) Views: (22) by darkcod5
Google 468 Banner Half-Life 2 Mods for Dummies
CoDWW Download
Forums
MODSonline.com Forums

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD 4 Level Design
CoD 4 mapping and level design.
Moderators: foyleman, rEdrUmMDK, Foxhound, Rasta, StrYdeR, The_Caretaker, batistablr, playername, Welshy
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access subscribe
Author Topic: CoD2 texture conversion
ITOE_MC
General Member
Since: Sep 3, 2006
Posts: 323
Last: Dec 1, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Sunday, Aug. 31, 2008 02:46 pm
I converted one texture from CoD2 to CoD4 in Assman, using the normal and specular maps in addition to the color map, and it looked pretty crappy -- not nearly as nice as it looks in CoD2.

Has anyone else tried this successfully? (I seem to remember reading that CoD4 does something new with normal maps, but I'm a total novice at this, so I may well be doing something wrong.)
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Sunday, Aug. 31, 2008 03:36 pm
how did you convert your texture?

there are cod4 version of iwi2dds and dds2iwi, further the nvidia dds tools etc.
Morphisnb
General Member
Since: May 7, 2006
Posts: 289
Last: Nov 25, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Sunday, Aug. 31, 2008 03:42 pm
When you convert the normal map .iwi back to a .dds and open it in Photoshop it basically looks like a hieght map. (grey/black)

I take that and make it back into a Normal map using the Nvidia Normal Map & DDS Plug-in for Photoshop.
http://developer.nvidia.com/object/photoshop_dds_plugins.html
Then Save that as a .tga file.

The Spec map I convert to a .dds, open in Photoshop and save as a .tga file.
There is a strength setting in Assman for the specular map so you can turn it down if it's too strong.

The Texture/Color map I convert to .dds and usually just use that as is.
ITOE_MC
General Member
Since: Sep 3, 2006
Posts: 323
Last: Dec 1, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Sunday, Aug. 31, 2008 08:14 pm

Quote:
how did you convert your texture?


I used the CoD2 version of .iwi to .dds.


Quote:
When you convert the normal map .iwi back to a .dds and open it in Photoshop it basically looks like a hieght map. (grey/black)

I take that and make it back into a Normal map using the Nvidia Normal Map & DDS Plug-in for Photoshop.


I'll give that a try. I use the Gimp, but it has a normal map converter.

Thanks for the help, guys.
NSGod
General Member
Since: Feb 16, 2008
Posts: 13
Last: Sep 1, 2008
[view latest posts]
Level 1
Category: CoD 4 Level Design
Posted: Monday, Sep. 1, 2008 12:09 pm
While Morphisnb's post is headed in the right general direction, there's a general procedure I've worked out in "reverse compiling" IW's four image types.

The following is from some other posts I've made on the subject:

Most model phong and world phong materials use a combination of 4 images: color map, normal map, specular map and cosine power map. Most color and normal maps are easy to find as their names are usually tagged with "_col" or "_nml", etc. The specular and cosine power maps are combined into a single .iwi image whose name is prefixed with a "~". The beginning of their name is usually similar to their color map name and the end usually has some extra stuff added.

I use IWI_X_DDS to convert the .iwi's to .dds's. (Not IWItoDDS, which is rather lame as you have to individually drag and drop images). IWI_X_DDS is available at:
http://www.diegologic.net/CoD/iwi_x_dds.htm. Be sure to check to see if you have the latest version, as he's updated it a number of times.

Note that while it seems that this utility will convert color maps straight away, normal map images and spec+cos map images need to be tweaked in Photoshop before you'll have a full source image.

The specular+cosine map images are the easiest to convert. The dds image you open in Photoshop will be an RGBA image (with an alpha channel). The RGB information is what makes up the specular map, and the alpha channel is what makes up the cosine power map. Note that while the specular map image (RGB) is usually monotone, for some materials (like metals) there is actually definite color information. I usually just copy the alpha channel to a new RGB image by itself, save that as the cosine map, delete the alpha channel from the original image which can then be saved as the specular map.

The normal map images are a little more difficult to convert back to the original image. Before we go any further, I want to clarify the terms I'll be using to distinguish between different versions of images. The following image shows the normal map image for the M4, which IW provided at the following location:

\Call of Duty 4 - Modern Warfare\model_export\modern_weapons\m16\weapon_m4_nml.tga

Here's the image:



This is what I'll refer to as a "source" normal map image. It's the image you'll specify in Asset Manager in order to generate what I'll refer to as a "compiled" normal map image. (In reality, what's happening here is that the normal map image is being saved in a DXT5+alpha format in order to create the highest possible quality image with a minimum of DXT-related artifacts).

First of all when examining the source normal map image, we notice it's an RGB image with no alpha channel. Next, we'll look at the individual channels:

The Red channel:




The Red channel appears as a grayscale image where the subject in the image appears to be lit directly from the right.

The Green channel:




The Green channel appears as a grayscale image where the subject in the image appears to be lit directly from the bottom.

The Blue channel:




The Blue channel is mostly solid white, with only a small amount of discernible detail (I've zoomed in on one such spot in the image above).


Next, we'll take a look at a compiled normal map image like you'll find in the various stock .iwd files. The following image is the color map for the fire hydrant model used in the game ("hydrant_c.iwi") (I'm showing this merely for reference, so that you know what object the normal map image corresponds to):




The following image shows the compiled form of the corresponding normal map image ("hydrant_n.iwi"):




This .dds image was converted from the original hydrant_n.iwi. This compiled normal map image appears quite different than the source normal map image shown above. It doesn't have the usual blue/pink/purple hue that a source normal map image has; instead, it's essentially monotone in appearance. Moreover, it has an alpha channel unlike the source normal map image shown above.

You cannot directly use a compiled normal map image as a source normal map image; doing so will produce unexpected results. It may not appear immediately obvious, but if we take a closer look at the compiled normal map image, we can figure out how to "reverse" the compile process and arrive at a usable source version of our normal map image.

If you look once again at the R, G, and B channels of the hydrant normal map image shown above, it appears as if the subject in the image is lit directly from the bottom. This is similar to the green channel in our example source normal map image shown earlier.

If you then look at the alpha channel in the compiled normal map image, you'll notice that it appears as though the subject in the image is being lit directly from the right. This is similar to the red channel in our example source normal map image shown earlier.




So, by now we've formed a tentative game plan:

1) The composite information from the Red, Green, and Blue channels of the compiled normal map image will become the green channel of our source normal map image.

2) The information from the Alpha channel of the compiled normal map image will become the red channel of our source normal map image.

3) We will initially fill the Blue channel of our source normal map image with pure white.

4) We'll then use the nvidia normal map filter on our source normal map image thus far to generate the small amount of data (the "height" information) into our Blue channel.

The above game plan can be represented graphically as the following:





Now, step by step.

Select the Red, Green, and Blue channels of the compiled normal map image. Switch to the Layers palette, and Select All. Copy the Selection, then switch back to the Channels palette. In the Channels palette, select only the Green channel (click directly on it and all other channels will be deselected). Now paste the information into the green channel. Now click on the Alpha channel in the Channels palette so only it is visible. You should still have a marquee with the entire image selected, now Copy the information in the Alpha channel. As before, in the Channels palette, select only the Red channel and paste the information from the Alpha channel into it. Select only the Blue channel, make sure all of the image is selected (Ctl-A), then choose Edit > Fill... and fill the selection with White. Delete the Alpha channel and then click on "RGB" in the Channels palette to select all three channels (R, G, and B). Then, you need to apply the Nvidia normal map filter with settings as follows:




The important filter settings are outlined in Red. Note that the usual settings such as sample size (4 sample, 3 x 3, 5 x 5) and Min Z Scale (directly above the "3D View Options" text) shouldn't have any effect on the outcome, since the "Normalize only" option (which means that the image is already a normal map, and that we just want to re-normalize it) will determine the entire output.

If you recall, our blue channel was entirely white prior to running this filter. As you can see in the image below, after running the filter with these settings, we now have the small amount of height information present in the blue channel (look for the faint outlines of the hex nuts in the upper left corner):





You should then flatten this image and save it as a Targa image (.tga) to be used in Asset Manager. Since there are only 3 channels in this image, saving it as a 24-bit .tga is sufficient. (32 bit targa is only needed if there's an alpha channel).

I've saved this procedure as an Adobe Photoshop CS3 Action for those who have Photoshop: http://www.markdouma.com/cod/COD4Actions.zip (.zip, ~ 1 KB).

Make sure you have the latest version of the Nvidia DDS plugin also. They're available at: http://developer.nvidia.com/object/photoshop_dds_plugins.html

Hope this helps....


Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Monday, Sep. 1, 2008 12:22 pm
permission to add this to modsonwiki?
Morphisnb
General Member
Since: May 7, 2006
Posts: 289
Last: Nov 25, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Monday, Sep. 1, 2008 01:17 pm
Great Info NSGod [thumbs_up]

Photoshop Actions Tutorial: HERE
(for those that don't know what they are, like me)

Yes please save that in a Tutorial/Wiki for everyones benefit. [wave]
ITOE_MC
General Member
Since: Sep 3, 2006
Posts: 323
Last: Dec 1, 2008
[view latest posts]
Level 5
Category: CoD 4 Level Design
Posted: Monday, Sep. 1, 2008 02:54 pm
Great information. Thanks.

It's all a bit beyond me, since I don't have Photoshop, but I hope others will make use of it. We could use some more textures.
Sevenz
General Member
Since: Apr 24, 2006
Posts: 1133
Last: Nov 28, 2008
[view latest posts]
Level 8
Category: CoD 4 Level Design
Posted: Monday, Sep. 1, 2008 03:47 pm
Wiki: Call of Duty 4: Textures
Restricted Access Restricted Access subscribe
MODSonline.com Forums : Call of Duty 4 : CoD 4 Level Design
All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
MODSonline Subscriptions
Partners
Battle for Europe COD2
CODAddicts - Call of Duty News & Downloads
The Firing Box
Call of Duty Headquarters
Frag Universe
modbase.be
XoXide
Ask About
Advertising
Friends
The Clan Database
CoD 4 Base
SOF2 Files and Downloads
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:
12/07/2008 12:00 EST

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware