永恆之火 发表于 2014-10-17 21:21:19

MatFX section builder

本帖最后由 永恆之火 于 2014-10-17 21:33 编辑

在國外論壇找到這個工具,似乎可以讓武器使用法線貼圖(normal map)
似乎是要用RW Analyze修改DFF,研究了好久還是無解
http://i.imgur.com/Ezyaz69.jpg

人物似乎也可以用
http://i.imgur.com/hv2m4ZB.jpg
原文討論串
readme內容:
MatFX tool 1.0
Author: DK22Pac

Assembly
MatFX section file has an extension .mfx.
In the folder with MatFxTool.exe there are two folders - mfx and txt.
Txt folder used to build .mfx files from .txt files.
Mfx folder is used to retrieve .txt files from .mfx files.

For example, we have a file m4.txt, which describe the parameters necessary for our section.
Put this file in the folder txt, run exe, and we obtain (in the same folder) .mfx file,
which must be imported into dff.

Txt-file format

The first parameter in file is a version of DFF (version of RenderWare).
The number has HEX-format with leading 0x.

0x00000304 - GTA III PS2
0x00000310 - GTA III PS2, GTA III PC
0x0800FFFF - GTA III PC
0x0C02FFFF - GTA VC PC
0x1003FFFF - GTA III XBOX, GTA VC XBOX
0x1005FFFF - GTA VC Android
0x1400FFFF - GTA III Android
0x1803FFFF - GTA SA, Manhunt

It is followed with the type of effect.

Supported types of effects:
BUMPMAP - height map
ENVMAP - reflection map
BUMPENVMAP - bump map + reflection map
DUAL - double texturing

And then - the data section.

Example file format: BUMPMAP

DffVersion: 0x1803FFFF
MatFxType   BUMPMAP
### parameters ###
BumpMapBumpiness 5.0
###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
Texture   0
BumpMapTex1      4         1            1            0          subplt_bump -

BumpMapBumpiness - intensity of the effect
Texture - the texture parameters to substitute the main texture
BumpMapTex - texture parameters for height map

Example file format: ENVMAP

DffVersion: 0x1803FFFF
MatFxType   ENVMAP
### parameters ###
EnvMapCoefficient 0.500
FrameBufferAlpha 0
###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
EnvMap      1      6         1            1            1          vehicle_generic_chromeprts -

EnvMapCoefficient - intensity of the reflections
FrameBufferAlpha - if you use a bump, and this option is enabled, the reflection map will take bump
distortion into account

Next come the texture parameters for reflection map.

Example file format: BUMPENVMAP
DffVersion: 0x1803FFFF
MatFxType   BUMPENVMAP
### parameters ###
BumpMapBumpiness 5.000
###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
Texture   0
BumpMapTex1      6         1            1            0          m4_bump -
### Env Map
EnvMapCoefficient 0.500
FrameBufferAlpha 0
###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
EnvMap      1      6         1            1            0          m4_chrome -

This file combines two effects parameters.

Example file format: DUAL

DffVersion: 0x1803FFFF
MatFxType   DUAL
### parameters ###
SrcBlendMode 2
DstBlendMode 2
###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
DualTex   1      6         1            1            0          dualtex -

SrcBlendMode - source pixel blending parameter
DstBlendMode - destination pixel blending parameter
DualTex - blending texture

Blend parameters:
0rwBLENDNABLEND
1rwBLENDZERO             (0,    0,    0,    0   )
2rwBLENDONE            (1,    1,    1,    1   )
3rwBLENDSRCCOLOR         (Rs,   Gs,   Bs,   As)
4rwBLENDINVSRCCOLOR      (1-Rs, 1-Gs, 1-Bs, 1-As)
5rwBLENDSRCALPHA         (As,   As,   As,   As)
6rwBLENDINVSRCALPHA      (1-As, 1-As, 1-As, 1-As)
7rwBLENDDESTALPHA      (Ad,   Ad,   Ad,   Ad)
8rwBLENDINVDESTALPHA   (1-Ad, 1-Ad, 1-Ad, 1-Ad)
9rwBLENDDESTCOLOR      (Rd,   Gd,   Bd,   Ad)
10 rwBLENDINVDESTCOLOR   (1-Rd, 1-Gd, 1-Bd, 1-Ad)
11 rwBLENDSRCALPHASAT      (f,    f,    f,    1   )f = min (As, 1-Ad)

Parameters of textures

Texture parameters are described in a single line, for example:

###         Enable Filtering U-addressing V-addressing HasMipMaps Name Alpha
EnvMap      1      6         1            1            0          m4_chrome -

Enable - enables/disables texture. When texture is disabled, its not necessary
to describe otherparameters.
Filtering - texture filtering
U-addressing, V-addressing - texture addressing
HasMipMaps - presence of texture mipmapping
Name - name of the texture
Alpha - the name of the texture alpha mask

Types of texture filtering:
0 rwFILTERNAFILTERMODE
1 rwFILTERNEAREST
2 rwFILTERLINEAR
3 rwFILTERMIPNEAREST
4 rwFILTERMIPLINEAR
5 rwFILTERLINEARMIPNEAREST
6 rwFILTERLINEARMIPLINEAR

Types of texture addressing:
0 rwTEXTUREADDRESSNATEXTUREADDRESS
1 rwTEXTUREADDRESSWRAP
2 rwTEXTUREADDRESSMIRROR
3 rwTEXTUREADDRESSCLAMP
4 rwTEXTUREADDRESSBORDER

This file may contain comments. To insert a comment put a '#' or ';' character (without quotes)
at the line beginning.

Importing section

MatFX section should be located in a section of the material Extension. ID of this section - 0x120

Material
<Material data>
Extension
   MatFX

Atomic geometry which uses this material must also have MatFX section
in extensions. However, here we are talking about a different format section
(use file MatFXAtomic.mfx) or take this section from dff which
uses MatFX effects (vehicles for example).


Atomic
   <Atomic data>
   Extension
       MatFX (MatFXAtomic.mfx)

Restrictions
Bump texture effect
-They can not use compressed raster
-They can not use a transparent bitmap
-They can not use mipmapping
In GTA SA MatFX effects don't work on vehicle models.

Assembling textures
Use OpenIV and WTD2TXD for assembly and final txd (for bump textures - use format X8R8G8B8, without mip-mapping).


That's all. If you happen to collect the working section -
congratulations, you have a new level of hard modders!
Long live the notepad-modding!


百度云附件:MatFXTool (3,VC,SA).rar   



1436460352 发表于 2014-10-17 21:29:33

{:7_202:}看不懂的渣渣路过

a1365970207 发表于 2014-10-17 21:39:46

惊现大神{:5_135:}{:5_135:}{:5_135:}

SONY 发表于 2014-10-17 21:41:14

...好像很複雜         

神殇 发表于 2014-10-17 21:44:55

有什么用?

日月断晨 发表于 2014-10-17 21:46:52

好深奥的样子

不一样的GTA 发表于 2014-10-17 22:02:37

可惜的动漫人物不通用法线啊{:6_177:}

萩原夏树 发表于 2014-10-17 22:06:32

{:5_126:}很厉害的样子 可惜看不懂

2384172605 发表于 2014-10-17 22:24:13

LZ你该不会是打开一个文件用记事本打开然后复制再粘贴吧

低调~小鑫 发表于 2014-10-17 22:30:11

只是进来看看。。。

无名客 发表于 2014-10-17 23:13:49

看不懂

飞机控 发表于 2014-10-18 07:32:14

{:5_128:}{:5_129:}{:5_129:}{:5_129:}不懂啊{:5_138:}

イザナギ羽翼 发表于 2014-10-18 07:36:58

大神{:6_176:}

kami 发表于 2014-10-18 13:28:25

{:6_176:}所噶

明明就是我 发表于 2014-10-19 23:31:57

看不懂也要下载
页: [1]
查看完整版本: MatFX section builder