Wednesday, October 6, 2010

SF4 Beginners Guide to Material Attribute Swapping

Credit for this tutorial goes to alekqz, I just cleaned it up a bit.

This tutorial will show you how to give a body part a reflective, metallic look, but a similar process can be used to grab other materials, such as Akuma's glowing eyes.

1. First, open a *.cos.emz file using piecemontee's Asset Explorer and look for the body part you wish to modify, in this case, Zangief's upper body:
Take note of the name used to reference the body part, in this case, 'body.'

2. Next, open a decompressed *.col.emz file in a hex editor (I use the free Frhed, but any hex editor will work) and search for that body part name:
Below the name, you will find the material type attribute, usually something like SpcBumpBrush with some more letters and stuff after it, like this:
3. Now, we want to overwrite that material type with 'SpcEnv_W.' In hex, we want to paste in (53 70 63 45 6E 76 5F 57 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E 00 00 00).

As with all hex-editing in SF4, it's very important that you overwrite because the resulting files must be *exactly* the same size as the original or the game will crash. It should look like this when we're finished:
4. Next, we need to scroll down to the bottom of that section, just before the next section starts, and look for BrushA, BrushB and BrushC, like this:
We want to replaces those Brush entries with ReflectCoeff (52 65 66 6C 65 63 74 43 6F 65 66 66), ReflectFresnelBias (52 65 66 6C 65 63 74 46 72 65 73 6E 65 6C 42 69 61 73) and ReflectFresnelCoeff (3C 52 65 66 6C 65 63 74 46 72 65 73 6E 65 6C 43 6F 65 66 66), respectively (forgive the typo in the pictures; it's Fresnel, not Fesnel):
5. Finally, in the case of metal effects, we have to choose how reflective we want to make the material (also known as 'specularity'). This is controlled by modifying the spaces after the Reflect* entries. For a chrome-type effect, change the last 2 numbers in each section to @ symbols (40 40), like this:
For an enamel-type effect, the last 2 numbers after ReflectCoeff and ReflectFresnelCoeff need to be a Euro symbol and a question mark, like this (the last 2 after ReflectFresnelBias should be blank--or 00 00 in hex):
For a polished effect, the last 4 numbers of the sections need to be changed to the hex code of (CD CC CC 3D), (CD CC CC 3D) and (66 66 66 3F), respectively, like this:
Save your file and you're done!

These are the only 3 metal effects known so far, but there may be more, so be adventurous! Experiment!

Update 10/18/2010: sensibeat tracked down 3 more metal effects:
metal_gold (less reflective):
ReflectCoeff ÍÌL= (CD CC 4C 3D)
ReflectFresnelBias .×#< (0A D7 23 3C)
ReflectFresnelCoeff ÍÌÌ= (CD CC CC 3D)

metal_silver (more reflective):
ReflectCoeff €? (80 3F)
ReflectFresnelBias ÍÌÌ= (CD CC CC 3D)
ReflectFresnelCoeff €@ (80 40)

crystal (highly reflective, mirror-like):
ReflectCoeff ÍÌÌ> (CD CC CC 3E)
ReflectFresnelBias 333? (33 33 33 3F)
ReflectFresnelCoeff ? (3F)

One word of caution: you'll want to modify the DDS textures to look like whatever material you're trying to mimic but don't make it too dark, as the reflection can make it hard to see.

Cari Farmasi

Farmasi Di Kuala Lumpur dan Selangor Selangor / KL Area NO SHOPS NAMES ...