I'm going to add more to this for those who like to hex edit.[color=#FFBF40]Maveritchell[/color] wrote:If you want to enable transparency, open up your .msh file with a hexeditor and find the name of the texture to which you're going to give transparency (search for .tga), say it's rep_inf_sharpshooter_cape.
Once your cursor is on the name of the .tga, move it back a few places to where it says HBATRB - place your cursor on the place immediately after the last "B."
The next 8 places should be:Change that to:
- 04 00 00 00 00 00 00 00
Then save the msh file and give your actual texture an alpha channel.
- 04 00 00 00 04 00 00 00
Common Flags
Transparency and tick box options are found 5th place over from ATRB (Ex. 41 54 52 42 04 00 00 00 00)
- Hex/Name
00 - No transparency/no options ticked
04 - Single sided Transparency
08 - Double sided Transparency
10 - Hard Edged Transparency (only) ***See Notes
14 - Single sided Transparency with Hard Edged Transparency option ticked
18 - Double sided Transparency with Hard Edged Transparency option ticked ****See Notes
They were previously unknown because they couldn't be produced by the options given in our version of Edit Flags. They're still used in the game but must be hex edited into the material by hand or by using ANDEWEGET's ZE Tools to export from Softimage|XSI.
Pandemic obviously used a more advanced version of Edit Flags at their studio, the BF2_materials.doc shows an image of a different version than was shipped with the modtools.
Their version was likely designed for optimizing assets for Xbox and PS2, and was probably stripped down before releasing the tools which gives a different appearance.
Material Properties
Render Types are found 6th place over from ATRB (Ex. 41 54 52 42 04 00 00 00 00 00)
- Render Type/Hex/Rendertype name
0 ----------- 00 - Nothing/normal
1 ----------- 01 - Glow (unused? -No shader for RenderType?)
2 ----------- 02 - Lightmap
3 ----------- 03 - Scrolling *See Notes
4 ----------- 04 - Specular (See THIS topic by AQT)
5 ----------- 05 - Gloss Map
6 ----------- 06 - Chrome (environment map)
7 ----------- 07 - Animated (See THIS post)
8 ----------- 08 - Ice
9 ----------- 09 - Sky
10 ---------- 0a - Water
11 ---------- 0b - Detail (will "glow" but probably not meant to) (See THIS post)
12 ---------- 0c - 2 Scroll (V)
13 ---------- 0d - Rotate
14 ---------- 0e - Glow Rotate
15 ---------- 0f - Planar Reflection
16 ---------- 10 - Glow Scroll
17 ---------- 11 - Glow 2 Scroll
18 ---------- 12 - Curved Reflection
19 ---------- 13 - NormalMap Fade
20 ---------- 14 - NormalMap InvFade
21 ---------- 15 - Ice Reflection
22 ---------- 16 - Ice Refraction (See THIS post by AQT)
23 ---------- 17 - Emboss
24 ---------- 18 - Wireframe (Examples use a bump texture in slot TX1D)
25 ---------- 19 - Energy **See Notes
26 ---------- 1a - Afterburner
27 ---------- 1b - Bumpmap (See THIS post)
28 ---------- 1c - Bumpmap+Glossmap
29 ---------- 1d - Bumpmap+Detailmap+Envmap
30 ---------- 1e - MultiState
31 ---------- 1f - Shield
- Render Type above refers to the #s given in the SWBF2 Edit Flags list
The Render Type name list is based off the SWBF1 "fixed" xsiaddon Edit Flags, not Squipples grid.
Some Render Types also require a texture input or/in addition to alpha channel in order to work properly.
Some of the render types might be named incorrectly or are mixed up and some may not even work on PC.
Notes:
- *Data0 (U or horizontal) -Scroll speed is 7th place over from ATRB (Ex. 41 54 52 42 04 00 00 00 00 00 00)
*Data1 (V or vertical) -Scroll speed is 8th place over from ATRB (Ex. 41 54 52 42 04 00 00 00 00 00 00 00)
*You can use this information to adjust your scroll speeds in the msh file rather than having to re-export the msh, to save time.
- **Data1 -Frequency of the throbbing diffuse texture can be adjusted.
- ***The use of hard-edged transparency will eliminate the "transparency interference" you get when two objects with transparency are viewed one in front of the other.
Thanks to Maveritchell for this information.
- ****It appears this is used along with Data0 and Data1 according to fel1_bldg_pitcher_M.msh and seems to be used a lot on foliage or plant props
Here's a translation of the Material DATA chunk to XSI's material property page.
I'll post more when I find the time...